diff --git a/README.md b/README.md index 80fac49..0254ebf 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ web mcp --provider brave ``` The server exposes five read-only tools: `search`, `fetch`, `docs_resolve`, -`docs_fetch`, and `sgraph_search`. Its stdout is reserved for MCP protocol +`docs_fetch`, and `source_search`. Its stdout is reserved for MCP protocol messages; diagnostics go to stderr. For a client-rendered page, explicitly call `fetch` with `render: "agent-browser"` and an integer `waitMs`; this optional retry requires a host-installed executable and never happens automatically. @@ -77,7 +77,7 @@ Install the independently bundled Pi extension: pi install npm:@guionai/pi-web ``` -It registers `web_search`, `web_fetch`, `web_docs`, and `web_sgraph` and calls +It registers `web_search`, `web_fetch`, `web_docs`, and `web_source_search` and calls the bundled core in-process. Pi and TypeBox are peer dependencies supplied by the host; no CLI executable or MCP configuration is required. `web_fetch` uses direct fetch by default and can explicitly use `render: "agent-browser"` with diff --git a/packages/dsh-web/src/tools.ts b/packages/dsh-web/src/tools.ts index 564a920..937ca67 100644 --- a/packages/dsh-web/src/tools.ts +++ b/packages/dsh-web/src/tools.ts @@ -344,13 +344,17 @@ function webSgraphTool( ): ToolDefinition { return strictDefinition( defineTool({ - name: "web_sgraph", + name: "web_source_search", description: "Search public source code through Sourcegraph.", parameters: sgraphParameters, output: sgraphOutput, isConcurrencySafe: () => true, async execute(args, exec) { - rejectUnknownFields(args, Object.keys(sgraphParameters), "web_sgraph"); + rejectUnknownFields( + args, + Object.keys(sgraphParameters), + "web_source_search", + ); return operations.sgraphSearch({ query: requireString(args, "query"), count: args.count, diff --git a/packages/dsh-web/test/tools.test.ts b/packages/dsh-web/test/tools.test.ts index b3fabf3..ff92f27 100644 --- a/packages/dsh-web/test/tools.test.ts +++ b/packages/dsh-web/test/tools.test.ts @@ -46,12 +46,12 @@ describe("DSH direct web tools", () => { expect(definitions.map((definition) => definition.name)).toEqual([ "web_fetch", "web_docs", - "web_sgraph", + "web_source_search", ]); expect(registered.map((definition) => definition.name)).toEqual([ "web_fetch", "web_docs", - "web_sgraph", + "web_source_search", ]); expect([ definitions[0]!.isConcurrencySafe?.({ url: "https://example.test" }), diff --git a/packages/pi-web/src/tool.ts b/packages/pi-web/src/tool.ts index 9f4d73d..85838f5 100644 --- a/packages/pi-web/src/tool.ts +++ b/packages/pi-web/src/tool.ts @@ -159,7 +159,7 @@ const DOCS_PROMPT_GUIDELINES = [ "For web_docs action fetch, provide the library_id returned by action resolve; use topic or tokens to narrow the result.", ]; const SGRAPH_PROMPT_GUIDELINES = [ - "Use web_sgraph to search public source code through Sourcegraph.", + "Use web_source_search to search public source code through Sourcegraph.", ]; function environmentCredentials(): WebCredentials { @@ -383,11 +383,11 @@ export function webDocsTool(dependencies: WebToolDependencies = {}) { export function webSgraphTool(dependencies: WebToolDependencies = {}) { const operations = dependencies.operations ?? createWebOperations(); return makeTool({ - name: "web_sgraph", + name: "web_source_search", label: "Web source search", description: "Search public source code through Sourcegraph. Text output is limited to 2,000 lines or 50KB; truncated output is saved to a temporary file.", - promptSnippet: "Search public source code with web_sgraph", + promptSnippet: "Search public source code with web_source_search", promptGuidelines: SGRAPH_PROMPT_GUIDELINES, parameters: webSgraphSchema, execute: async (params, signal) => { diff --git a/packages/pi-web/test/packed-smoke.mjs b/packages/pi-web/test/packed-smoke.mjs index efae927..4ed55b6 100644 --- a/packages/pi-web/test/packed-smoke.mjs +++ b/packages/pi-web/test/packed-smoke.mjs @@ -110,7 +110,7 @@ try { extension.default({ registerTool: (tool) => registered.push(tool) }); if ( registered.map((tool) => tool.name).join(",") !== - "web_search,web_fetch,web_docs,web_sgraph" + "web_search,web_fetch,web_docs,web_source_search" ) { throw new Error("packed extension did not register exactly four web tools"); } diff --git a/packages/web/src/mcp.ts b/packages/web/src/mcp.ts index 4c7b634..ce4e637 100644 --- a/packages/web/src/mcp.ts +++ b/packages/web/src/mcp.ts @@ -313,7 +313,7 @@ export function createMcpServer(dependencies: McpDependencies): McpServer { ); server.registerTool( - "sgraph_search", + "source_search", toolConfig( "Search public source code", "Search public source code through Sourcegraph and return Markdown results.", diff --git a/packages/web/test/mcp.test.ts b/packages/web/test/mcp.test.ts index f0349a4..68ef7b2 100644 --- a/packages/web/test/mcp.test.ts +++ b/packages/web/test/mcp.test.ts @@ -213,7 +213,7 @@ describe("web stdio MCP adapter", () => { "docs_resolve", "fetch", "search", - "sgraph_search", + "source_search", ]); for (const tool of tools) { expect(tool.annotations).toMatchObject({ @@ -233,7 +233,7 @@ describe("web stdio MCP adapter", () => { >; const docsFetchProperties = byName.docs_fetch!.inputSchema .properties! as Record; - const sgraphProperties = byName.sgraph_search!.inputSchema + const sgraphProperties = byName.source_search!.inputSchema .properties! as Record; expect(fetchProperties.tree_threshold).toMatchObject({ default: 5000 }); expect(fetchProperties.render).toMatchObject({ @@ -283,7 +283,7 @@ describe("web stdio MCP adapter", () => { }, }); const sgraph = await client.callTool({ - name: "sgraph_search", + name: "source_search", arguments: { query: "repo:guionai" }, }); diff --git a/packages/web/test/packed-smoke.mjs b/packages/web/test/packed-smoke.mjs index ef8114b..ae3fdcb 100644 --- a/packages/web/test/packed-smoke.mjs +++ b/packages/web/test/packed-smoke.mjs @@ -163,7 +163,7 @@ else console.log(JSON.stringify({ success: true, data: {} })); "docs_resolve", "fetch", "search", - "sgraph_search", + "source_search", ]) ) { throw new Error(`packed MCP tools = ${names.join(", ")}`);