Repository navigation
fix(mcp): promote enterprise_search under the search name - #32
Conversation
Deployments that serve Glean search as enterprise_search lost the tool from the plugin, because the remote tool filter matched exact names. List it as search instead; the server dispatches a search call to enterprise_search, so calls need no change.
|
Thanks for tracking this down, @shashank-tomar-glean. The local server needs to match whatever the remote serves. Deployments serve this tool as either Right now the tool is renamed to search in Instead, can we use whichever name the remote uses, on every surface?
On the skills: the ones that say Tests I'd like to see:
|
|
Follow-up for the skills side is up in #33. It adds a pluginpack partial that says |
Summary
On Glean deployments that serve Glean search as
enterprise_search, the plugin has no search tool. The remote tool filter matches exact names and its allowlist only hassearch, soenterprise_searchis silently dropped. Without it, document questions detour throughfind_skills_and_toolsandrun_tool, or throughchat.This change lists
enterprise_searchunder the namesearch. Calls need no change: the Glean server dispatches asearchcall toenterprise_searchon deployments that serve that name. Keeping the namesearchmeans the bundled skills and references, which all callsearch, stay accurate on every deployment, whichever name it serves.Changes
shared/glean/mcp/src/tools/remote-passthrough.ts: when filtering the remote tool list, mapenterprise_searchtosearch, and listsearchonly once if a server ever serves both names.shared/glean/mcp/tests/remote-passthrough.test.ts: cover the rename and the both-names case.The alternative is to add
enterprise_searchtoREMOTE_TOOLS_ALLOWLIST. That works without a mapping, but the tool's name would then vary by deployment, and the skills that saysearchwould name a tool that isn't listed.Testing
npm run typecheck:bundle,npm run test:bundle(434 tests), andnpm test(build plus validate for claude, cursor, and codex) all pass.enterprise_search:chat,employee_search,memory,memory_schema,read_document, anduser_activity, plus its ownsetup,find_skills_and_tools, andrun_tool. With it, the list also hassearch.searchcall through the plugin returns results. The server routes it toenterprise_search.find_skills_and_toolstwice, tworun_toolsearches whose top results were product documentation, thenchatandread_document. With it, Codex made three directsearchcalls and found the doc.meeting_lookuprather thansearch.