#11558

coding-agent: support namespace-scoped tool_search queries

OpenBlackGanglionopened 10d ago

What do you want to change?

Add namespace-scoped discovery to tool_search, for example +docs read_page, so a model can constrain discovery to one MCP server.

Why?

When several servers expose similar tools, +docs read_page is currently treated as ordinary search text. The + does not filter candidates, so another server's tool can rank first, particularly with limit: 1. Exact-name prioritization does not solve this: the entire query no longer matches the tool name.

Code Mode already has searchTools(query, { namespace }); tool_search has no equivalent constraint. This is a proposal for new syntax, not a claim that Pi already promises to support +.

How? (optional)

Parse a leading +namespace, match the registered namespace name or alias, then rank the remaining query with the existing BM25 implementation. This keeps tools from other namespaces out even when their descriptions mention the requested service. Unknown namespaces return no matches; ordinary queries and exposure restrictions remain unchanged.

The prefix would mean a namespace selector, not a general required-keyword operator. Would you prefer this syntax or an explicit namespace argument?

I have an implementation on my fork with regression tests; npm run check and ./test.sh pass. I would like to submit a PR once the approach and contributor approval are confirmed.

Activity

0

No activity yet.