Skip to content

Commit 36738d2

Browse files
mikipaletclaude
andcommitted
feat(mcp): add openWorldHint to all tool annotations
ChatGPT Apps submission requires all three hints (readOnlyHint, destructiveHint, openWorldHint) set explicitly; we only had the first two. openWorldHint mirrors read_only: write tools act on external social platforms (publish/send/manage) so they touch the open world; GET tools only read and don't change external state. Set in the generator (294 tools) and the @tool_def decorator (20 custom tools); regenerated. Verified 0/314 missing. Also gitignore the chatgpt-app-submission.json artifact (generated for the submission form, not source). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 26623ff commit 36738d2

4 files changed

Lines changed: 306 additions & 297 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,4 @@ Thumbs.db
8181

8282
# Project specific
8383
*.log
84+
chatgpt-app-submission.json

scripts/generate_mcp_tools.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,16 @@ def generate_tool_handler(
423423
# Strip trailing whitespace from all docstring lines
424424
docstring = "\n ".join(line.rstrip() for line in doc_lines)
425425

426-
# Tool annotation (Anthropic Connectors Directory requirement). title is
427-
# rendered via repr() so quotes/specials in the summary are escaped safely.
426+
# Tool annotation (required by the Anthropic Connectors Directory AND the
427+
# ChatGPT Apps submission, which needs all three hints set explicitly).
428+
# title is rendered via repr() so quotes/specials in the summary are
429+
# escaped safely. openWorldHint mirrors read_only: write tools act on
430+
# external social platforms (publish/send/etc.) so they touch the open
431+
# world; GET tools only read, so they don't change external state.
428432
annotation = (
429433
f"annotations=ToolAnnotations(title={title!r}, "
430-
f"readOnlyHint={read_only}, destructiveHint={not read_only})"
434+
f"readOnlyHint={read_only}, destructiveHint={not read_only}, "
435+
f"openWorldHint={not read_only})"
431436
)
432437

433438
lines.append("")

0 commit comments

Comments
 (0)