Repository navigation
mcp(docs): Show how to read tool results - #195
Merged
Merged
Conversation
This was referenced Dec 5, 2026
why: An SDK client could discover inputs without learning how to decode a result, use its cursor or distinguish an admitted workspace change from a completed operation. what: - Name the JSON text envelope and result fields in tool discovery. - Ship a Go SDK example that walks pages and captures an exact pane. - Document tool errors, omitted fields and operation polling.
why: An MCP client learns how to decode a tool result during initialization. The discovery test still passed if the handshake lost those instructions. what: - Check both response fields in the real initialize reply.
tony
force-pushed
the
mcp-client-guide
branch
from
December 6, 2026 01:08
910e6e5 to
15ee04c
Compare
tony
added a commit
that referenced
this pull request
Dec 6, 2026
why: A tmux hook could add output to a pane or option read. A large MCP reply could hide an operation outcome or advance a cursor before the client received the page. what: - Fit the Program listener to the server socket path, wake waiters on exit, and retry pane removal after a lost reply (#191, #192, #193). - Keep MCP operation outcomes readable and size pages before advancing their cursors. Show the STDIO client reading a result (#194, #195). - Keep hook output out of pane captures and option reads. Use `Pane.wait_for_text/4` in the notebook (#196, #197). - Check root exit separately from trace delivery in cold-start tests (#198). - Document checkout dependencies, inherited sockets and capability APIs (#199, #200, #201).
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.
Closes #182.
What changed, and why
MCP callers need to decode tool results, follow continuation cursors and distinguish admission from workspace completion. Tool discovery describes the response fields. The package ships a Go SDK example that finds a named session across pages and captures an exact pane.
The guide uses the result fields and cursor behavior from #194.
Checks run
The STDIO suites ran on pristine tmux 3.3 and upstream 3.8. The packaged client also ran against a relocated Linux release with the Go MCP SDK and read a pane beyond the first session page.
Review evidence
MCP initialization owns client instructions and the tool catalogue owns per-operation descriptions. The packed Go client consumes the public STDIO protocol, including continuation and tool errors.
With the topic tests and the runtime code from
89df3c4ba, the focused check failed. The old initialization reply omitted response-decoding instructions, and the old catalogue omitted pagination guidance. The focused test failed in 5.28 s and passed on15ee04c78in 5.39 s.mix test --warnings-as-errors --max-cases 2 --seed 624498 test/stdio_test.exs:16frompackages/mcpIndependent reversions also distinguished the two owners. Keeping the new test and reverting initialization alone failed in 1.40 s. Reverting tool descriptions alone failed in 1.33 s. The restored exchange passed in 1.89 s.
An independent reviewer recorded
NO FINDINGSon910e6e544.Merge stack
The client guide uses the response and cursor contract in #194. Stack #206 · Changes in this PR
All six required Linux jobs passed on
15ee04c78. GitHub records the stack merge at15b285de9. CI run · Merged commitTool use
Codex extracted this change from #169 and ran the checks above on the topic branch. A separate Codex reviewer checked the component boundaries and the two corrected test fixtures.