Skip to content

feat: every tool tells MCP clients whether it reads, changes or destroys - #100

Merged
DMontgomery40 merged 5 commits into
mainfrom
feat/tool-annotations
Nov 4, 2026
Merged

DMontgomery40 merged 5 commits into
mainfrom
feat/tool-annotations

Conversation

@DMontgomery40

@DMontgomery40 DMontgomery40 commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

MCP clients can't tell which of this server's tools only read and which move, heat, print, delete or overwrite. Only inspect_print_file and two Counterpart tools had annotations, and two of those were incomplete. Counterpart's remote /v1/mcp endpoint will give each device scopes (read, control, print, design) based on these hints, so they have to be right.

Every one of the 57 tools now declares all four MCP hints (readOnlyHint, destructiveHint, idempotentHint, openWorldHint). Each value comes from reading what the tool's handler actually does. They live in one table, src/tool-annotations.ts, which is applied when tools are listed. tests/tool-annotations.test.mjs fails if a listed tool has no annotations or the table names a tool that isn't listed. It pins the exact read-only set (the future read scope), so adding a read-only tool means changing the test on purpose. A tool missing from the table is listed with the most cautious hints. It also fails if a read-only tool is marked destructive or non-idempotent, and it pins the hints the scopes depend on. The hints don't gate anything: every print and control still runs the server's own checks.

Judgment calls

  • Starting a print is not destructive in itself (start_print*, upload_file with print: true). It adds a job and removes nothing, and the printer runs its own checks. print_3mf, print_3mf_bambu_network and print_collar_charm are marked destructive only because they may auto-slice, which replaces an earlier slice output (found in review). No print call is idempotent: a repeat starts another job. Print scope should be keyed by tool, not by destructiveHint.
  • Destructive: cancel_print (the job can't be resumed), skip_objects, delete_printer_file, clear_hms_errors, x2d_native_control (replaces AMS metadata or the calibration selection), and the raw blender_mcp_call and fusion_mcp_call. bambu_network_call allows only handshake and sign-in reads, but by default it sets up the bridge agent, which writes config and certificates, so it is marked like the status probe.
  • Not destructive: pause, resume, temperature, fan, light, speed, airduct and drying. Each sets a value the next call can set back.
  • Overwrites count as destructive (found in review). This covers STL edits, slicing and get_slice_settings, which replace an earlier output of the same name in the server's temp folder, and save_template. It also covers counterpart_print_route, which replaces .env values, and the bambu_network_bridge_status probe, because connect: true writes bridge config and certificates. blender_mcp_edit_model counts too, since its legacy bridge doesn't preserve the scene.
  • camera_snapshot is not read-only. save_path overwrites a file. A remote read scope that wants snapshots should drop save_path.
  • camera_stream_start/camera_stream_stop are not read-only (found in review). They change the one stream every viewer of the printer shares, but send no printer commands. A read scope that needs live view must allow camera_stream_start by name. camera_frame and blender_mcp_status are read-only.
  • fusion_mcp_status is not read-only, because launch: true starts Fusion.
  • openWorldHint is true for anything that reaches the printer, Bambu Cloud, a remote slicer (orca-slicer-api, which is also why slicing isn't idempotent), Blender, Fusion or Bambu Connect. It is false for local file tools and counterpart_printer_info.

No version bump, because releases are on hold. The CHANGELOG entry is under Unreleased.

Proof: full npm test on the head commit: 1036 tests, 1032 pass, 0 fail. The 4 skips need Linux, a C++ compiler or a real FULU host. The new test also lists the tools through a real stdio MCP client.

Council review

Rounds: 2

Delegate Round 1 Round 2
Claude Opus 5.5 8/10 9/10
Muse Wonder 1.0 7/10 9/10
GPT-6.1 Sol 7/10 10/10

Round 1 changes: camera stream start/stop are no longer read-only; auto-slicing print tools are destructive; the bambu_network_call rationale is corrected; make-3MF and Fusion export are idempotent; missing tools get cautious hints; and the read-only set is pinned. Round 2 approved, and its two test nits are applied.

Reviewed with sol-loop: 2 rounds with gpt-6.1-sol. Sol verdict: approved

…view

readOnlyHint, destructiveHint, idempotentHint and openWorldHint for all
57 tools, kept in one table (src/tool-annotations.ts) and applied when
tools are listed. A test fails if any listed tool lacks them or the
table names a tool that is not listed.
…review

Slicing, STL edits and settings extraction replace an earlier output of the
same name; the bridge connect probe writes its configuration and certificates;
counterpart_print_route replaces .env values; the legacy Blender bridge does
not preserve the scene. Remote slicing is a new job each call.
@DMontgomery40

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T10:44:42.719168Z d29c3c1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: c6cddc485a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ly or additive @codex review

Camera start/stop change the stream all viewers share. print_3mf and its
siblings may auto-slice, replacing an earlier output. bambu_network_call
allows only reads but sets up the bridge agent. A tool missing from the
table now gets the most cautious hints, and the test pins the exact
read-only set.
@DMontgomery40

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: c6cddc485a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@DMontgomery40

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6cddc485a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/tool-annotations.ts Resolved
Comment thread src/tool-annotations.ts Resolved
@codex review
@DMontgomery40

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: d29c3c1893

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@DMontgomery40
DMontgomery40 merged commit 5a173a8 into main Nov 4, 2026
4 checks passed
@DMontgomery40
DMontgomery40 deleted the feat/tool-annotations branch November 4, 2026 12:15
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.

1 participant