TypeScript
Reject unknown params in t3_thread_read (#17823)
Miklós Fazekasee2763e9b20f
diff --git a/apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.ts b/apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.tsindex aeae1a94c68..0b3d1b0e18c 100644--- a/apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.ts+++ b/apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.ts@@ -1426,6 +1426,12 @@ describe("orchestrator MCP toolkit", () => {expect(threadListTool?.tool.annotations?.idempotentHint).toBe(true);const threadReadTool = server.tools.find(({ tool }) => tool.name === "t3_thread_read");expect(threadReadTool?.tool.annotations?.readOnlyHint).toBe(false);+ expect(threadReadTool?.tool.inputSchema).toMatchObject({ additionalProperties: false });+ const unknownPagingParamError = yield* invoke("t3_thread_read", {+ threadId: parentThreadId,+ cursor: 90,+ }).pipe(Effect.flip);+ expect(unknownPagingParamError.message).toContain("Expected no excess property");const threadUpdateTool = server.tools.find(({ tool }) => tool.name === "t3_thread_update",);diff --git a/apps/server/src/mcp/toolkits/orchestrator/tools.ts b/apps/server/src/mcp/toolkits/orchestrator/tools.tsindex 3248618a2de..f2c34bb22cb 100644--- a/apps/server/src/mcp/toolkits/orchestrator/tools.ts+++ b/apps/server/src/mcp/toolkits/orchestrator/tools.ts@@ -214,6 +214,8 @@ const ThreadReadTool = Tool.make("t3_thread_read", {dependencies,}).annotate(Tool.Title, "Read a T3 thread")+ // Strict so a misspelled paging param fails instead of silently reading from position 0.+ .annotate(Tool.Strict, true).annotate(Tool.Readonly, false).annotate(Tool.Destructive, false).annotate(Tool.Idempotent, true);