Skip to content

feat(mcp): give every tool all three hints, with the reason for each - #2260

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/mcp-tool-hints
Nov 10, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/mcp-tool-hints

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

PR 1 of the MCP over OAuth plan (#2141, approved by the owner on 2026-11-10). It is independent of the OAuth work and can merge on its own.

ChatGPT's app review needs readOnlyHint, destructiveHint and openWorldHint on every tool, each with a written reason. Wrong or missing hints are its most common rejection. Claude's directory needs a title and the applicable readOnlyHint or destructiveHint, which every tool already had.

What changes

  • The 48 read tools (list_*, get_*) now state destructiveHint: false. Before, they stated only readOnlyHint and openWorldHint. A read changes nothing and reads only what Ansvisor stores: none fetches a page or calls an LLM.
  • dismiss_topic_suggestion and dismiss_prompt_suggestion are now destructiveHint: true.
    • A dismissed suggestion can't be brought back: there is no restore anywhere in the app. dismiss_task_review was already destructive for the same reason.
    • Their descriptions now say "A dismissal can't be undone."
    • The effect: Claude always asks before it dismisses a suggestion, as it already does before generate_content_brief and dismiss_task_review.
  • Every other write's hints were checked against what it does, and none changes:
    • override_mention_sentiment keeps the correction history;
    • the update_*_status tools set a status the same tool can set back;
    • create_improve_action sends suggestions that already exist and calls no LLM, so it stays inside Ansvisor.
  • Docs: docs/guides/mcp-server.mdx has a new Tool hints section.
    • One line covers the reads.
    • A table covers the 17 writes: Destructive, Repeatable and Outside Ansvisor, with the reason for each. That table is the text for the directory forms.
    • The intro paragraph about annotations now says every tool states all three hints.
  • Tests (web/src/lib/mcp/server.test.ts):
    • every tool has all three hints, and a read is destructiveHint: false and openWorldHint: false;
    • the destructive tools are exactly dismiss_prompt_suggestion, dismiss_task_review, dismiss_topic_suggestion and generate_content_brief;
    • every write has a row in the guide's Tool hints table, and the row's yes/no values match the server's hints. Each row's reason is longer than 20 characters, so a later change to a hint can't leave the docs (and the submission text) wrong.

No migration. No change a person sees in the app, so no Help change.

Related issue

Part of #2141

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. cd web && npx vitest run src/lib/mcp/server.test.ts: 5 tests pass.
  2. Change any write's destructiveHint in server.ts, or a yes/no in the guide's Tool hints table, and run the test again: it fails and names the tool.
  3. With an API key, list the tools (MCP Inspector, or claude mcp add and ask "list the Ansvisor tools"). Every tool shows readOnlyHint, destructiveHint and openWorldHint, and the two dismiss_*_suggestion tools show destructiveHint: true.

Checklist

  • Branch follows the naming convention (feature/mcp-tool-hints)
  • Commits follow Conventional Commits
  • yarn lint passes (eslint on the changed files: 0 problems)
  • yarn typecheck passes (0 errors)
  • yarn format:check passes
  • Tests: src/lib/mcp, src/lib/chat/registry and src/app/api/mcp: 63 files, 575 tests passed
  • Changes are focused — one concern per PR
  • Help article updated under help/ (or no user-visible change): no change a person sees in the app

Checked on 8a794ec, which merges cleanly into current main.


Generated by Claude Code

ChatGPT's app review needs readOnlyHint, destructiveHint and openWorldHint
on every tool, with a reason for each; the 48 read tools stated no
destructiveHint. They now say false: a list_ or get_ tool reads what
Ansvisor stores, changes nothing and reaches nothing outside it.

dismiss_topic_suggestion and dismiss_prompt_suggestion are now destructive:
a dismissed suggestion can't be brought back, as dismiss_task_review
already says. Their descriptions say so.

The MCP guide's new Tool hints table gives each write's hints and why; the
server test checks the table against the server, so the reasons pasted
into a directory form match what clients read.

Part of ansvisor#2141.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
@mintlify

mintlify Bot commented Nov 10, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 8a794ec.

Approve preview

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

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.

3 participants