From 6bcde3763c1a802c62cb1b157f1ced2e2cd5064c Mon Sep 17 00:00:00 2001 From: somuai Date: Fri, 4 Sep 2026 01:39:06 +0530 Subject: [PATCH] fix(sequentialthinking): set accurate readOnlyHint and idempotentHint annotations - Set readOnlyHint: false because the server maintains per-session thoughtHistory and branches state - Set idempotentHint: false because sequential calls produce different history lengths - Add regression assertion in input-schema.test.ts - Fixes #4721 --- .../__tests__/input-schema.test.ts | 12 ++++++++++++ src/sequentialthinking/index.ts | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/sequentialthinking/__tests__/input-schema.test.ts b/src/sequentialthinking/__tests__/input-schema.test.ts index 4ff7be663c..6bcc354f08 100644 --- a/src/sequentialthinking/__tests__/input-schema.test.ts +++ b/src/sequentialthinking/__tests__/input-schema.test.ts @@ -30,6 +30,18 @@ describe.skipIf(!existsSync(distIndexPath))('sequentialthinking input schema', ( await client?.close(); }); + it('advertises accurate annotations (stateful and non-idempotent)', async () => { + const { tools } = await client.listTools(); + const tool = tools.find(t => t.name === 'sequentialthinking'); + expect(tool).toBeDefined(); + expect(tool!.annotations).toEqual({ + readOnlyHint: false, + destructiveHint: false, + idempotentHint: false, + openWorldHint: false, + }); + }); + it('advertises nextThoughtNeeded as required', async () => { const { tools } = await client.listTools(); const tool = tools.find(t => t.name === 'sequentialthinking'); diff --git a/src/sequentialthinking/index.ts b/src/sequentialthinking/index.ts index 1ae09d1db8..8be1f9a568 100644 --- a/src/sequentialthinking/index.ts +++ b/src/sequentialthinking/index.ts @@ -93,9 +93,9 @@ You should: needsMoreThoughts: coercedBoolean.optional().describe("If more thoughts are needed") }, annotations: { - readOnlyHint: true, + readOnlyHint: false, destructiveHint: false, - idempotentHint: true, + idempotentHint: false, openWorldHint: false, }, outputSchema: {