keep the write_episode example inside the client's 2048-char window - #38
Merged
Conversation
Claude Code truncates an MCP tool description at 2048 characters and reports it
as a debug line nobody reads. Restarting the eigen session surfaced one:
Tool "write_episode" description truncated from 2252 to 2048 chars
Every session that has ever connected saw the description cut mid-word:
...entities=[{"name": "Postgres", "type": "tool"}, {"name": "Decisi
The whole facts=[...] argument - source, target, relation_type, fact,
confidence - was never shown. The only worked example for the tool stopped
before demonstrating half the call, in the tool whose adoption is the entire
problem this project exists to solve. A cut example is worse than no example,
because it still reads as authoritative.
The docstring is now 1723 characters, 325 under the limit, with the example
whole. Nothing was dropped that a caller needs; the prose around it was
tightened.
Length is a correctness property here, so it is now tested against the
descriptions the server actually publishes rather than the source text: every
tool under the limit, 100 characters of headroom so an ordinary edit fails the
build before it fails a client, the example balanced and complete, every
required argument and all three confidence values inside the window.
Each guard was verified to fail against the bug reintroduced, not merely to
pass - the practice the eigen session adopted after a guard that had only ever
passed turned out to assert nothing.
411 tests pass, 5 added.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Surfaced by restarting the eigen session — a debug line in the MCP connection log:
What every session has actually been seeing
Cut mid-word. The entire
facts=[...]argument —source,target,relation_type,fact,confidence— is never shown.The only worked example for
write_episodestopped before demonstrating half the call. In the tool whose adoption is the entire problem this project exists to solve. A truncated example is worse than no example, because it still reads as authoritative.This has been true in every session that ever connected, and the only trace was a debug line nobody reads.
The fix
Docstring is now 1723 chars, 325 under the limit, example intact. Nothing a caller needs was dropped — the surrounding prose was tightened.
Why it is tested, not just fixed
Length is a correctness property here, and crossing the limit is silent. The tests read the descriptions the server actually publishes (
_tool_manager.list_tools()), so they measure what a client receives rather than what the source looks like:(),[],{}all matchedscope,session_id,entities,facts) and every fact key visibleconfidencevalues inside the window, since the server rejects anything elseEach guard was verified to fail against the bug reintroduced — 4 of 5 fail when the docstring is re-bloated — rather than merely passing. That's the practice the eigen session adopted after finding a guard that had only ever passed and asserted nothing.
Testing
411 pass, 5 added.