Expand description
Unified tool-catalog primitive (#474, P1) — extracted from apps/core.
One searchable catalog across MCP servers + built-ins + Composio + plugin
tools + Agent Skills — no parallel registry. run_search ranks descriptors
with a
swappable ToolRanker (BM25 default, semantic rerank as a second impl
seam, selectable via a pref key mirroring catalog.active_source.{kind}).
describe_from_parts / describe_composio return a tool’s argument
schema.
Contract 1 (spec Appendix A, verbatim): ToolKind / ToolDescriptor /
DescribedTool / DescribedArg.
§The boundary type is ToolDescriptor, never Core’s RegistryTool
This crate owns the catalog contract + ranker + describe-shaping — the
portable data layer. What stays Core-side (bound to the McpRegistry
sidecar object + the built-in server inventory) is the ingest adapter:
Core’s descriptor_from(&RegistryTool) maps its registry rows into
ToolDescriptor, classify_kind resolves the ToolKind from the
sidecar server inventory, and the Composio live fetch produces the composio
descriptors. Core then hands those descriptors to run_search /
describe_from_parts. So the crate never sees a Core type — zero
dependency on apps/core.
§The embedder seam (ToolEmbedder)
ToolRanker::Semantic embeds the query + candidates and ranks by cosine
similarity. The embedder is injected as a narrow ToolEmbedder trait
object; Core wraps its registry-driven retrieval::Embedder behind this in
apps/core/src/tool_registry_host.rs (the SearchEmbedder/search_host.rs
precedent).
Placement (CLAUDE.md §1): discovering what tools exist and ranking them is orchestration → Core. The allowlist verdict / budget / audit is Gateway.
Structs§
- Described
Arg - One argument of a
DescribedTool(Contract 1). - Described
Tool - A fully-described tool with its argument schema (Contract 1).
- Tool
Descriptor - A ranked tool descriptor (Contract 1).
Enums§
- Tool
Kind - Source plane of a catalog entry. Serializes lowercase:
mcp|builtin|composio|app, pluscore-apifor Core’s own HTTP endpoints exposed as agent-drivable tools,commandfor a declarative app tool that execs an allowlisted local CLI, andskillfor an Agent Skill. - Tool
Ranker - A swappable tool ranking strategy. BM25 is the default;
Semanticis a real embedder-backed second strategy (enum-dispatch inToolRanker::rank), not a placeholder — it embeds the query + candidates and ranks by cosine similarity.
Constants§
- RANKER_
PREF_ KEY - Pref key selecting the active ranker, mirroring
catalog.active_source.{kind}.
Traits§
- Tool
Embedder - A minimal embedder seam for
ToolRanker::Semantic. Core implements this intool_registry_host.rsover its registry-configuredretrieval::Embedderso this crate never depends onapps/core.embedreturnsNonewhen the embedder is unreachable, which the ranker treats as a documented BM25 fallback (not an error).
Functions§
- arg_
summary - Extract
(arg_names, arg_descriptions)from a JSON-schemainput_schema. TheRegistryTool→ToolDescriptoringest adapter lives Core-side; this is exported so that adapter can reuse the same arg-name extraction. - describe_
composio - Describe a
composio__<slug>id shallowly: a single freeformargumentsobject row (the action’s full schema is not listed). The pure body of the Composio branch of Core’sMcpRegistry::describe. - describe_
from_ parts - Build a fully-described tool from its parts — the pure body of the non-Composio
branch of Core’s
McpRegistry::describe. Core resolveskindvia its inventory-boundclassify_kindand passes the located tool’s fields; the crate owns the arg-schema parsing and theshallow/parametersshaping. - described_
args - Extract the full
DescribedArglist from aninput_schema. - run_
search - Run the unified tool-catalog search over already-gathered descriptors — the
pure body of Core’s
McpRegistry::search.