Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/sequentialthinking/__tests__/input-schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ describe.skipIf(!existsSync(distIndexPath))('sequentialthinking input schema', (
);
});

// Regression coverage for #4721: each call accumulates in-memory thought
// history, so the tool must not advertise itself as read-only or idempotent.
it('marks the tool as neither read-only nor idempotent', async () => {
const { tools } = await client.listTools();
const tool = tools.find(t => t.name === 'sequentialthinking');
expect(tool).toBeDefined();
expect(tool!.annotations?.readOnlyHint).toBe(false);
expect(tool!.annotations?.idempotentHint).toBe(false);
});

it('rejects a call that omits nextThoughtNeeded', async () => {
const result = await client.callTool({
name: 'sequentialthinking',
Expand Down
6 changes: 4 additions & 2 deletions src/sequentialthinking/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ You should:
needsMoreThoughts: coercedBoolean.optional().describe("If more thoughts are needed")
},
annotations: {
readOnlyHint: true,
// Each call appends to the server's in-memory thought history (and
// branch list), so the tool is neither read-only nor idempotent.
readOnlyHint: false,
destructiveHint: false,
idempotentHint: true,
idempotentHint: false,
openWorldHint: false,
},
outputSchema: {
Expand Down