Skip to content

Set destructiveHint and openWorldHint explicitly on every tool - #420

Merged
rafaeljusto merged 1 commit into
mainfrom
hints
Jul 31, 2026
Merged

Set destructiveHint and openWorldHint explicitly on every tool#420
rafaeljusto merged 1 commit into
mainfrom
hints

Conversation

@rafaeljusto

Copy link
Copy Markdown
Contributor

Description

OpenAI's app review rejected the submission because 190 tools omitted openWorldHint and/or destructiveHint from tools/list. Both are *bool with omitempty in go-sdk, so a nil value is dropped from the payload and the MCP spec then defaults each to true — the server was implicitly declaring every read tool open-world and destructive. (readOnlyHint was never actually missing: go-sdk v1.7 serialises it as a plain bool, false included.)

All 221 tool definitions across twprojects, twdesk, twchat and twspaces now set both hints to a concrete value. Values follow the existing convention and are unchanged where already declared: false everywhere, except DestructiveHint on the delete tools plus Desk create_ticket and reply_ticket, and OpenWorldHint on helpdoc create/update and those same two ticket tools.

TestAnnotationHintsAreExplicit in cmd/docs-gen builds all four products with allowDelete=true and fails on any nil hint, so a new tool cannot ship without them; it also rejects a tool annotated both read-only and destructive and documented in the AGENTS.md tool checklist.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • Tests pass locally (go test -v ./...)
  • Added/updated tests for new functionality

Checklist

  • Code follows project style guidelines
  • Self-reviewed the code
  • Added necessary documentation
  • No new warnings or errors

OpenAI's app review rejected the submission because 190 tools omitted
openWorldHint and/or destructiveHint from tools/list. Both are *bool with
omitempty in go-sdk, so a nil value is dropped from the payload and the
MCP spec then defaults each to true — the server was implicitly declaring
every read tool open-world and destructive. (readOnlyHint was never
actually missing: go-sdk v1.7 serializes it as a plain bool, false
included.)

All 221 tool definitions across twprojects, twdesk, twchat and twspaces
now set both hints to a concrete value. Values follow the existing
convention and are unchanged where already declared: false everywhere,
except DestructiveHint on the delete tools plus Desk create_ticket and
reply_ticket, and OpenWorldHint on helpdoc create/update and those same
two ticket tools.

TestAnnotationHintsAreExplicit in cmd/docs-gen builds all four products
with allowDelete=true and fails on any nil hint, so a new tool cannot ship
without them; it also rejects a tool annotated both read-only and
destructive. Documented in the AGENTS.md tool checklist.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rafaeljusto
rafaeljusto requested a review from a team as a code owner July 31, 2026 15:58
@rafaeljusto
rafaeljusto merged commit eaa28df into main Jul 31, 2026
3 checks passed
@rafaeljusto
rafaeljusto deleted the hints branch July 31, 2026 16:01
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