Skip to content

fix(mcp): make every tool's hints match what it does - #54

Merged
frahlg merged 1 commit into
mainfrom
fix/mcp-tool-annotations
Nov 2, 2026
Merged

frahlg merged 1 commit into
mainfrom
fix/mcp-tool-annotations

Conversation

@frahlg

@frahlg frahlg commented Nov 2, 2026

Copy link
Copy Markdown
Member

Problem

OpenAI's plugin review rejected FTW: "One or more of your tool's annotations do not appear to match the tool's behavior." The listing set all hints as booleans, but several values were wrong.

Change

Tool Before After Why
setup_edit, setup_reset, setup_validate, setup_test, setup_connect destructive false destructive true They overwrite or discard draft answers, the whole draft or a draft credential.
goal_request, car_goal_request destructive false destructive true Approved, they replace a setting or schedule; clear removes the car's schedule.
setup_discover, setup_test, setup_connect open world false open world true Network scan, a user-typed device address, a vendor sign-in.
setup_discover read-only false read-only true It only reads; Core fails the call if the draft changed.

Every other tool keeps its hints. setup_begin stays read-only. Its description now says that the tool only reads, and that the client may first ask the owner for the setup grant.

openWorld is a new field on tool. The setup tools derive their hints: every setup write is destructive, and the three preparations are open world. hints_test.go writes out all three hints for all 29 tools, checks both protocol families, and fails for a tool with no row. It replaces TestChargeNowIsMarkedDestructive.

docs/public-plugin.md gives the reason for each hint. Its tool list also had only 14 of the 27 public tools; it now lists all of them.

internal/mcp grows by 14 lines of Go without tests.

Evidence

Run locally on this branch:

  • go vet ./..., go test -race -count=1 ./..., go test -count=1 -tags ftwclouddev ./... and bash scripts/check-imports.sh all pass.
  • Setting the setup writes back to non-destructive makes TestToolHintsMatchTheTable fail on all seven, as it should.

I checked the behaviour behind each hint against Core at srcfl/ftw master:

  • handleSetupPrepare: discovery changes no draft; the test may rotate a draft token.
  • The myUplink callback writes refresh_token into the draft.
  • ValidateWithCheck saves the normalized draft.
  • RestartWithCheck discards it.
  • Agent API reads are GET only.

🤖 Generated with Claude Code

OpenAI's plugin review rejected FTW because tool annotations did not match
behaviour. Four kinds of error:

- setup_edit, setup_reset, setup_validate, setup_test and setup_connect
  overwrite or discard the draft or its credentials but said
  destructiveHint false.
- goal_request and car_goal_request replace a setting or schedule once the
  owner approves, and car_goal_request can clear it, but said
  destructiveHint false.
- openWorldHint was false for every tool. setup_discover scans the home
  network, setup_test reaches an address the user typed into the draft,
  and setup_connect signs in at a vendor. They now say true.
- setup_discover only reads (Core fails it if the draft changed) but said
  readOnlyHint false.

hints_test.go pins all three hints for all 29 tools in both protocol
families, and fails for a tool with no row. docs/public-plugin.md gives
the reason for each hint and lists the 27 public tools the profile serves.

internal/mcp grows by 14 lines of Go without tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-02T16:36:36.775609Z f59614f PR opened
ℹ️ 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.

@frahlg
frahlg merged commit 9ded6b0 into main Nov 2, 2026
2 checks passed
@frahlg
frahlg deleted the fix/mcp-tool-annotations branch November 2, 2026 16:42
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