Skip to content

[connectors] Single tool registry — one definition → runtime + MCP + API #85

Description

@serge-ivo

[connectors] Single tool registry — one definition → runtime + MCP + API

The enabling refactor. Today a tool is defined up to 3× (runtime AGENT_TOOLS/STORAGE_TOOLS def + switch/case executor in lib/tools.ts/lib/storage-tools.ts, and a hand-written MCP server.tool() in workers/mcp), with names drifting. Every new capability triples the work and rots.

Do

  • One ToolDef { name, description, schema (JSON Schema), handler(ctx, input), tier, connector? } as the source of truth (extend the existing shared ToolDef in lib/tools.ts).
  • Runtime tool-calling (agent-think.ts loop) derives definitions + dispatch from the registry (replace the switch/case with a registry lookup).
  • MCP (workers/mcp) auto-generates its tools from the registry (kill the hand-written list + naming drift).
  • Keep the per-agent allowlist (config.capabilities.tools) semantics unchanged.

Acceptance

  • Adding a tool in ONE place makes it available in runtime + MCP (+ the generic API issue) with matching names.
  • Existing tools behave identically; full API + MCP suites green.
  • No duplicate tool definitions remain.

Part of the connector/tool framework epic. Blocks the connector work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    connectorsConnector + tool framework

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions