Skip to content

fix(sequentialthinking): correct readOnlyHint and idempotentHint annotations - #4747

Open
somuai wants to merge 1 commit into
modelcontextprotocol:mainfrom
somuai:fix-sequential-thinking-annotations
Open

fix(sequentialthinking): correct readOnlyHint and idempotentHint annotations#4747
somuai wants to merge 1 commit into
modelcontextprotocol:mainfrom
somuai:fix-sequential-thinking-annotations

Conversation

@somuai

@somuai somuai commented Sep 3, 2026

Copy link
Copy Markdown

Resolves #4721.

Problem

The sequentialthinking tool annotations previously specified readOnlyHint: true and idempotentHint: true. However:

  1. The server maintains per-session instance state (thoughtHistory and branches), which mutates on every processThought invocation. It is therefore stateful, not read-only.
  2. Repeated calls with identical arguments yield different thoughtHistoryLength values (and mutate branches), making the tool non-idempotent by definition. Clients relying on readOnlyHint (e.g. for parallel execution safety) or idempotentHint (e.g. for caching or automatic retries) would encounter unexpected side effects.

Solution

  • Set readOnlyHint: false and idempotentHint: false in src/sequentialthinking/index.ts.
  • Added regression test in src/sequentialthinking/__tests__/input-schema.test.ts verifying that advertised tool annotations accurately reflect statefulness.

… 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 modelcontextprotocol#4721
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sequential-thinking: readOnlyHint and idempotentHint annotations are inaccurate (server is stateful, non-idempotent)

1 participant