Repository navigation
fix(get_canister_candid): carry the interface text in the structured output - #229
Merged
Merged
Conversation
…output Clients that read structuredContent (Claude Code among them) drop the text blocks, so since #222 they received the interface's size and flags but never the .did itself. Add the `candid` field back to GetCandidOutput. Co-Authored-By: Claude Opus 5.5 <[email protected]>
aterga
previously approved these changes
Nov 3, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The schema change conflicts with an existing test assertion, while duplicated, unbounded Candid output risks oversized responses and client truncation.
2 open issues
What changed in this PR
Restores Candid interface text in get_canister_candid structured output so clients that ignore text blocks can still read the interface.
Changes:
- Adds
candidto the output type and populates it with the rendered interface. - Updates unit and end-to-end reply assertions to expect structured interface text.
- Revises tool descriptions and documentation to describe both output locations.
| File | Description |
|---|---|
| README.md | Documents the structured candid field. |
| crates/imcp2-core/src/tools.rs | Populates candid and updates tool descriptions and reply assertions. |
| crates/imcp2-core/src/e2e_canister_tools.rs | Checks that structured output includes the full interface. |
| crates/imcp2-core/src/calls.rs | Adds the public candid output field and its documentation. |
Review effort: Balanced
…ized renderings Co-Authored-By: Claude Opus 5.5 <[email protected]>
aterga
approved these changes
Nov 3, 2026
This was referenced Nov 10, 2026
aterga
pushed a commit
that referenced
this pull request
Nov 19, 2026
* Bump crates to 0.7.0 All three crates share one version. A minor bump: since 0.6.1 the server gained the deploy tools (bundle host, upload store, pipeline, MCP tools, remote serving and metrics, #261, #265, #266), the cap on the MCP request body behind the bearer gate (#241), vetted-connector branding surfaced to Internet Identity (#200), and get_canister_candid now carries the interface text in its structured output (#229). The rc-0.7.0 candidate needs this on main first: deploy-candidate.yml and publish-crate.yml both refuse a tag whose version disagrees with every Cargo.toml. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VP2vTGJNrpdaVxN1aY8XSX * Deploy tools: say per server how to hand icp_deploy the bundle again #266 rewrote the icp_deploy description and hard-coded its step (2) as "upload that bundle via icp_deploy_upload". The local server does not list that tool: it takes the bundle as `bundle_path`. The sentence that IcDeployTools::tools() put in per server was anchored on text the rewrite removed, so it silently stopped being put in, and a_server_lists_the_bundle_argument_it_takes has failed on main since. Step (2) is now the anchor. The description says "hand that bundle to this tool", and each server replaces that with its own way in: upload via `icp_deploy_upload` on a server with an upload store, the bundle's absolute path as `bundle_path` on one without. The hosted server's text is what #266 wrote, with the tool name in backticks. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VP2vTGJNrpdaVxN1aY8XSX * README: depend on imcp2 0.7 `imcp2 = "0.6"` matches 0.6.x only, and the README ships in the crate, so a reader of 0.7.0's page would be told to depend on the release before it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VP2vTGJNrpdaVxN1aY8XSX * Deploy tools: keep the description's step (2) as written Review asked for the description's text back. The tool's description in the source says step (2) as #266 wrote it, "upload that bundle via icp_deploy_upload", and the hosted server lists it unchanged. Only a server without an upload store, imcp2-local, puts "pass that bundle's absolute path as `bundle_path`" in its place, since it lists no icp_deploy_upload. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VP2vTGJNrpdaVxN1aY8XSX --------- Co-authored-by: Claude <[email protected]>
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.


Clients that read
structuredContent(Claude Code among them) show the model only that object and drop the text blocks. Since #222 the structured output ofget_canister_candiddescribed the interface (bytes,methods, flags) without carrying it, so those clients never received the.didtext.This adds the
candidfield back toGetCandidOutput. Replies are kept to 5 KB, so carrying the text in both places stays small.🤖 Generated with Claude Code