feat(monitors): Add monitor catalog tools#1057
Conversation
Add catalog-only tools for discovering cron monitors and inspecting monitor details, check-ins, and stats. Wire monitor URLs through get_sentry_resource while preserving the default direct tool surface. Co-Authored-By: Codex <codex@openai.com>
Use the project read scope for monitor details and only advertise monitor resources when the inspect monitor tool is available. This keeps generated catalog guidance aligned with the exposed tool surface. Co-Authored-By: Codex <codex@openai.com>
There was a problem hiding this comment.
get_sentry_resource inputSchema always exposes 'monitor' resourceType even in skill contexts where it will always fail
The resourceType enum in get_sentry_resource statically includes "monitor" in the tools/list inputSchema for all skill sessions, but the handler calls assertCatalogToolAvailable(context, "get_monitor_details", ...) which throws a UserInputError whenever get_monitor_details is absent — which is the case for all seer, triage, and preprod sessions. The context-aware description omits monitor in those contexts, but the schema still advertises it as a valid enum value; clients that enumerate enum members to decide valid calls will find a value that always errors in those sessions.
Evidence
get_sentry_resourcedeclaresskills: ["inspect", "triage", "seer", "preprod"](get-sentry-resource.ts:510), whileget_monitor_detailsdeclaresskills: ["inspect"]only (get-monitor-details.ts:72).- The
resourceTypez.enum inget-sentry-resource.tsalways includes"monitor", andgetFilteredInputSchemainavailability.tsonly removes constraint-bound params, not conditional enum values — so the wireinputSchemaalways shows"monitor"regardless of active skill. - At execution time, the
"monitor"switch arm unconditionally callsassertCatalogToolAvailable(context, "get_monitor_details", "Monitor")(get-sentry-resource.ts:735), which throwsUserInputErrorwheneveravailableToolNamesdoes not containget_monitor_details. - The
descriptionfunction conditionally omitsmonitorfrom the examples and resource-ID list whenmonitorResourcesAvailableis false (get-sentry-resource.ts:514-517), confirming the intent is context-dependent, but the schema is not adjusted to match.
Identified by Warden mcp-audit
Reject monitor detail requests that provide only one side of an absolute time range. This returns a clear local input error instead of forwarding partial start or end parameters to Sentry. Co-Authored-By: Codex <codex@openai.com>
Add catalog-only cron monitor tools so agents can discover monitors and inspect schedule, environment state, recent check-ins, and aggregate stats without expanding the default direct tool surface.
Agent-Facing Monitor Tools
find_monitorssupports organization-level monitor discovery with project, environment, owner, query, and limit filters.get_monitor_detailsbundles monitor metadata, recent check-ins, and stats into one agent-friendly response, usingprojectSlugOrIdwhen a monitor needs project scoping.Sentry Endpoint Handling
The API client uses upstream-confirmed monitor list, detail, check-in, and stats routes. Check-ins keep Sentry's
statsPeriod/start/enddate range params, while stats translate the agent-facing time range tosince/until/resolutionforStatsMixin.Catalog-Only Routing
get_sentry_resourcecan resolve monitor URLs throughget_monitor_details, but only when that catalog tool is available. Generated definitions confirm the direct tool surface remains unchanged.