Repository navigation
feat(mcp): omniroute_tool_search + one-line TS signatures — roadmap #4 - #5269
Conversation
- catalog: include compressionTools so omniroute_ccr_retrieve (absent from MCP_TOOLS) is searchable - README: add read:tools to the example OMNIROUTE_MCP_SCOPES string (else tool_search self-locks under enforcement) - remove dead scoreHaystack helper - regression test for the ccr_retrieve catalog entry
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Babysit summary — green except expected file-size own-growthCI: Unit fast-path (1/2, 2/2) ✅ · Vitest (fast-path) ✅ (confirms the local The one red — file-size own-growth (please rebaseline at merge):
Both are genuine own-growth on frozen files; same pattern rebaselined at merge across the roadmap. I did not edit Local validation: lint 0 errors · typecheck:core clean · check:cycles OK · docs-sync PASS · toolSearch suite 13/13 (+ regression) · check:complexity 1968 (baseline 1981) · check:cognitive-complexity 835 (baseline 841). Not merging — handing off for human merge + baseline bump. |
|
#5269 Fast Quality unblocker is ready: #5272 It extracts the tool_search schema/tool definition and server registration into focused modules, bringing the frozen files back under cap:
Validation on KooshaPari:fix/5269-mcp-tool-search-filesize / PR #5272:
|
Splits tool_search schema/registration to clear file-size cap; unblocks #5269
…heaper-inference#4 (cheaper-inference#5269) roadmap cheaper-inference#4: omniroute_tool_search + one-line TS signatures. Integrated into release/v3.8.40.
What
Adds a new MCP tool
omniroute_tool_searchthat does lexical keyword search over every MCP tool's name/description and returns the top matches as compact one-line TypeScript signatures (~half the JSON-schema token cost), so agents discover tools on demand instead of carrying all ~88 schemas every turn. Tier-1 item of the compression feature-extraction roadmap (#4).tools/liststays complete (no hidden tools / no deferred hot-subset in v1 — that's a follow-up, scoped to the Anthropic family). The static deny/allow reduction (toolCardinality.ts) is untouched.How
New pure
mcp-server/toolSearch/module:signature.ts—zodToTsSignature(name, inputSchema): Zod v4 introspection (field.type,_def.innerType,_def.entries) →name(args: { q: string; limit?: number }): Result. Never throws (try/catch →name(args: object)fallback).search.ts—searchTools: lexical scoring reusing thegetRelevanceScorepattern (phrase + tokenindexOfcounts; name weighted over description). Anti-ReDoS: never compilesnew RegExpon the query. Deterministic (stable name tie-break),limitclamped 1–25.catalog.ts—getAllToolDefinitions: aggregates all 10 tool collections (array + Record shapes), dedupes by name. IncludescompressionToolssoomniroute_ccr_retrieve(absent fromMCP_TOOLS) is searchable.handler.ts— excludes the tool from its own results; output is{query, count, tools: [{name, description, scopes, signature}]}— only metadata already ontools/listplus the synthesized signature.Wired into
server.tsmirroring the base-tool pattern; newread:toolsscope (resolved viaMCP_TOOL_MAP, enforced bywithScopeEnforcement).Core review hardening
A dedicated review caught: (1) CRITICAL —
compressionToolswas missing from the catalog, soomniroute_ccr_retrievewas unsearchable (fixed + regression test); (2) the README exampleOMNIROUTE_MCP_SCOPESstring lackedread:tools(would self-lock the discovery tool under enforcement — fixed); (3) removed a deadscoreHaystackhelper.Tests (TDD, vitest)
toolSearch.{signature,search,catalog,tool}.test.ts— all green (13 + the new regression). The e2e (InMemoryTransport) proves the tool appears intools/list, returnsomniroute_get_healthon top forquery:"health"with asignaturestring, carriesread:tools, and never returns itself.Gates (local)
lint 0 errors · typecheck:core clean · check:cycles OK · docs-sync PASS (CLAUDE.md/MCP-SERVER.md/README updated to 88 tools / 34 base / 31 scopes) · check:complexity 1968 (baseline 1981) · check:cognitive-complexity 835 (baseline 841).
Ready for review & merge.