From 21241d2323d323f405b3cff4692e01364b6ddbde Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Tue, 29 Sep 2026 18:42:42 +0800 Subject: [PATCH] test(mcp): validate defaults at tool boundary --- tests/boundary/mcp/officialTools.test.ts | 8 ++++++++ tests/boundary/mcp/toolRegistrationOptions.test.ts | 13 ------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/tests/boundary/mcp/officialTools.test.ts b/tests/boundary/mcp/officialTools.test.ts index 744a518f3..d47015a02 100644 --- a/tests/boundary/mcp/officialTools.test.ts +++ b/tests/boundary/mcp/officialTools.test.ts @@ -234,6 +234,14 @@ describe("official Hopper proxy tools", () => { case_sensitive: false, document: null, }); + expect( + invocations.find(({ name }) => name === "search_strings")?.arguments_, + ).toEqual({ + pattern: "hello", + mode: "literal", + case_sensitive: false, + document: null, + }); }); it("returns stable safe MCP error content", async () => { diff --git a/tests/boundary/mcp/toolRegistrationOptions.test.ts b/tests/boundary/mcp/toolRegistrationOptions.test.ts index bb8633145..3bccf3746 100644 --- a/tests/boundary/mcp/toolRegistrationOptions.test.ts +++ b/tests/boundary/mcp/toolRegistrationOptions.test.ts @@ -7,19 +7,6 @@ import { GENERATED_MCP_TOOL_CATALOG } from "../../../src/generatedMcpToolCatalog import { toolRegistrationOptions } from "../../../src/server/toolRegistrationOptions.js"; describe("tool registration options", () => { - it("preserves canonical Zod parsers in the SDK schemas", () => { - for (const contract of TOOL_CONTRACTS) { - const options = toolRegistrationOptions(contract); - expect(options.inputSchema).not.toBe(contract.inputSchema); - expect( - options.inputSchema.safeParse(contract.examples[0]?.input ?? {}), - ).toEqual( - contract.inputSchema.safeParse(contract.examples[0]?.input ?? {}), - ); - expect(options.outputSchema).toBe(contract.outputSchema); - } - }); - it("generates the checked-in catalog from the SDK wire projection", async () => { const server = new McpServer({ name: "catalog-test", version: "0" }); for (const contract of TOOL_CONTRACTS)