Skip to content

Commit ee2763e

Browse files
authored
Reject unknown params in t3_thread_read (pingdotgg#17823)
1 parent a5331e4 commit ee2763e

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,12 @@ describe("orchestrator MCP toolkit", () => {
14261426
expect(threadListTool?.tool.annotations?.idempotentHint).toBe(true);
14271427
const threadReadTool = server.tools.find(({ tool }) => tool.name === "t3_thread_read");
14281428
expect(threadReadTool?.tool.annotations?.readOnlyHint).toBe(false);
1429+
expect(threadReadTool?.tool.inputSchema).toMatchObject({ additionalProperties: false });
1430+
const unknownPagingParamError = yield* invoke("t3_thread_read", {
1431+
threadId: parentThreadId,
1432+
cursor: 90,
1433+
}).pipe(Effect.flip);
1434+
expect(unknownPagingParamError.message).toContain("Expected no excess property");
14291435
const threadUpdateTool = server.tools.find(
14301436
({ tool }) => tool.name === "t3_thread_update",
14311437
);

‎apps/server/src/mcp/toolkits/orchestrator/tools.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ const ThreadReadTool = Tool.make("t3_thread_read", {
214214
dependencies,
215215
})
216216
.annotate(Tool.Title, "Read a T3 thread")
217+
// Strict so a misspelled paging param fails instead of silently reading from position 0.
218+
.annotate(Tool.Strict, true)
217219
.annotate(Tool.Readonly, false)
218220
.annotate(Tool.Destructive, false)
219221
.annotate(Tool.Idempotent, true);

0 commit comments

Comments
 (0)