Skip to content

Give every MCP tool explicit safety hints and fix the event stats date range - #1490

Merged
daveearley merged 2 commits into
developfrom
fix/mcp-tool-annotations-stats-range
Nov 15, 2026
Merged

daveearley merged 2 commits into
developfrom
fix/mcp-tool-annotations-stats-range

Conversation

@daveearley

@daveearley daveearley commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Two fixes to the MCP server, needed before the ChatGPT app review.

Explicit tool safety hints. Tools only sent the hints they declared (IsReadOnly or IsDestructive), so readOnlyHint, destructiveHint and openWorldHint weren't all present. ApiTool now sends all three as booleans, and each tool's own attributes override the defaults.

  • openWorldHint is false by default, because most tools only read or change data inside the user's account.
  • It's true (#[IsOpenWorld]) only for the seven tools that reach outside the account:
    • they email people: add_attendee, resend_ticket, resend_order_confirmation
    • they fetch an outside image URL: set_event_cover_image, add_lineup_performer, update_ticket_design
    • it makes a page public: publish_event

Event stats date range. get_event_stats reported a today-only period instead of the whole event. resolveStatsDateRange loaded the event without event_occurrences, so its date getters returned null. It now loads the relation first.

Tests

  • HiEventsServerTest: every registered tool returns all three hints as booleans and is never both read-only and destructive, and a new test pins the exact list of open-world tools.
  • EventStatsFetchServiceTest: a regression test checks the whole-event range reaches the last occurrence's end.
  • Unit suite (2,531 tests), Feature suite (1,646 tests) and Pint pass locally.

.claude/rules/backend/mcp.md now records the open-world rule.

…e range

Every tool now reports readOnlyHint, destructiveHint and openWorldHint as
booleans. openWorldHint is false by default and true only for the tools
that reach outside the account: the ones that email people, fetch an image
URL or publish an event.

Event stats loaded the event without its occurrences, so the whole-event
range collapsed to today. Load event_occurrences before resolving it.
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

✅ E2E smoke tests: Everything passed.

Mode Result ✅ Passed ❌ Failed ⚠️ Flaky ⏭️ Skipped ⏱️ Duration
Self-hosted ✅ Passed 113 0 0 0 3m 52s

Open the run

loadRelation takes a Relationship, not a relation name, so the string
broke every event stats request with a 500.
@daveearley
daveearley merged commit b797476 into develop Nov 15, 2026
10 checks passed
@daveearley
daveearley deleted the fix/mcp-tool-annotations-stats-range branch November 15, 2026 22:19
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant