Tag-based tool discovery
Tag a server when you register it and every tag-scoped agent run picks up its tools, with no workflow code naming the server.
The situation
The tool inventory grows every month: a database server, a browser, a carrier API. An agent run should see the tools that fit its task, and a newly registered server should join without a code change.
The recipe
Tag the server at registration:
curl -X POST https://lt.acme.dev/api/mcp/servers \ -H "Authorization: Bearer $LT_TOKEN" -H 'Content-Type: application/json' \ -d '{ "name": "carrier-rates", "transport_type": "streamable-http", "transport_config": { "url": "https://rates.acme.dev/mcp" }, "tags": ["shipping", "http"], "auto_connect": true }'Ask a question scoped to those tags:
curl -X POST https://lt.acme.dev/api/insight/mcp-query \ -H "Authorization: Bearer $LT_TOKEN" -H 'Content-Type: application/json' \ -d '{ "prompt": "Cheapest 2-day rate for order ORD-1042", "tags": ["shipping"], "wait": true }'mcpQuery loads tools from servers matching any of the tags (findServersByTags(tags, 'any')), or every server when no tags are given. Tags are lowercase and hyphenated, stored as a GIN-indexed Postgres array. The router also checks compiled pipelines by full-text search and tag match before falling back to the dynamic loop.
The guarantee
The model sees and calls only the tools the workflow’s principal may call. A tool the model chooses acts as that principal and passes the same manifest gate it carries at /mcp. A workflow with no principal runs its tools as lt-system. See MCP.
Related patterns
Agents and MCP
A workflow is a tool
A compiled pipeline deploys as an MCP tool, so the next agent that meets the same case calls a deterministic fix instead of reasoning again.
Agents and MCP
Instance federation
One Long Tail calls another's tools over MCP with a service account the remote issues; neither side shares a database or a login.
Agents and MCP
Teach agents your vocabulary
A domain dictionary maps the floor's jargon to roles, facets and workflows, so an agent hears a noun and knows the query.
