fix(sequentialthinking): set readOnlyHint/idempotentHint to false - #4722
Open
Jack11111eee wants to merge 1 commit into
Open
fix(sequentialthinking): set readOnlyHint/idempotentHint to false#4722Jack11111eee wants to merge 1 commit into
Jack11111eee wants to merge 1 commit into
Conversation
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 is misleading: clients may skip confirmation or retry/caching safeguards they would otherwise apply. Flip both hints to false with a short comment explaining why, and add a regression test that lists the tools over stdio and asserts the annotations. Fixes modelcontextprotocol#4721
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Every
sequentialthinkingcall appends to the server's in-memorythoughtHistory(andbranches), and the response'sthoughtHistoryLengthgrows monotonically. Advertising the tool asread-only and idempotent is misleading and can cause clients to skip
confirmations or apply unsafe retry/caching policies.
This changes both annotations to
falseand adds a regression test thatlists tools over stdio and asserts the annotations. Thanks to
@hummbl-agent for the detailed reproduction and statefulness analysis in
#4721.
Fixes #4721
Publishing Your Server
This PR modifies an existing server and does not add or publish a server
listing.
Server Details
sequentialthinkingMotivation and Context
The server maintains per-session thought history and branch state, so
repeated calls are not read-only or idempotent. The other annotations remain
unchanged because they accurately describe the tool.
How Has This Been Tested?
npm run buildnpm testinsrc/sequentialthinking: 27 tests passed across 3 test filesNo LLM client test was run; this change is limited to protocol metadata and
its automated stdio regression test.
Breaking Changes
None. This corrects metadata that clients may use for safety and retry
behavior; it does not change the tool input or output schema.
Types of changes
Checklist
Additional context
The server's stateful behavior means clients should not treat repeated calls as
safe to cache or retry without considering the resulting state change.