Skip to content

Commit 8a4139c

Browse files
cliffhallJack11111eeeclaude
committed
fix(sequentialthinking): set readOnlyHint/idempotentHint to false
Every sequentialthinking call appends to the server's in-memory thoughtHistory (and branches) and returns a growing thoughtHistoryLength, so advertising readOnlyHint and idempotentHint as true was wrong: a client may skip a confirmation, or retry a call, on the strength of those hints. Set both to false, explicitly, with a comment saying why. destructiveHint and openWorldHint stay false: the tool only appends, and touches nothing outside the process. The values stay explicit rather than being dropped to the spec defaults: AGENTS.md asks for the hints to be set on every tool, and an explicit false reads as a decision rather than an omission. Flip the tools-list pinning test to the corrected annotations and drop its KNOWN BUG #4721 marker. Add a patch changeset. Ported from #4722 (against main), rewritten by hand because the Prettier reformat on v2/main keeps it from applying cleanly. The regression assertion lives in the existing tools-list suite instead of input-schema.test.ts. Fixes #4721 Co-authored-by: Jack11111eee <Jack11111eee@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
1 parent 571e2b3 commit 8a4139c

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-sequential-thinking": patch
3+
---
4+
5+
Advertise the `sequentialthinking` tool as `readOnlyHint: false` and `idempotentHint: false`. Every call appends to the server's thought history and branch map, so the tool was never read-only or idempotent. `destructiveHint` and `openWorldHint` stay `false`. (#4721)

‎src/sequentialthinking/__tests__/tools-list.test.ts‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@ describe("sequentialthinking: initialize and tools/list", () => {
5252
expect(tool.title).toBe("Sequential Thinking");
5353
});
5454

55-
// KNOWN BUG #4721: pins current (wrong) behavior; the fix changes this assertion.
5655
// #4721: the server keeps a thought history and branch map that every call
57-
// mutates, so readOnlyHint: true and idempotentHint: true are wrong for it.
58-
// Pinned as they are today; the fix changes this assertion on purpose.
59-
it("carries today's annotations (#4721: read-only and idempotent, though the tool is stateful)", () => {
56+
// mutates, so the tool is neither read-only nor idempotent. It is still not
57+
// destructive (it only appends) and not open-world.
58+
it("advertises the tool as stateful: not read-only, not idempotent, not destructive, closed-world", () => {
6059
expect(tool.annotations).toEqual({
61-
readOnlyHint: true,
60+
readOnlyHint: false,
6261
destructiveHint: false,
63-
idempotentHint: true,
62+
idempotentHint: false,
6463
openWorldHint: false,
6564
});
6665
});

‎src/sequentialthinking/index.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ You should:
138138
.describe("If more thoughts are needed"),
139139
},
140140
annotations: {
141-
readOnlyHint: true,
141+
// Each call appends to the server's in-memory thought history (and
142+
// branch list), so the tool is neither read-only nor idempotent (#4721).
143+
readOnlyHint: false,
142144
destructiveHint: false,
143-
idempotentHint: true,
145+
idempotentHint: false,
144146
openWorldHint: false,
145147
},
146148
outputSchema: {

0 commit comments

Comments
 (0)