Skip to content

feat(tools): Add outputSchema to get_monitor_details - #2020

Merged
dcramer merged 3 commits into
mainfrom
feat/get-monitor-details-structured-output
Nov 5, 2026
Merged

dcramer merged 3 commits into
mainfrom
feat/get-monitor-details-structured-output

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

get_monitor_details (cron monitors) now declares an outputSchema and returns structuredResult() on every success path, in place of handwritten markdown. This follows the Structured Content policy in docs/contributing/tool-responses.md.

  • Explicit mapping: monitor metadata, config, environments, recent check-ins, and optional stats are mapped field by field.
  • Units are in the field names:
    • checkinMarginMinutes and maxRuntimeMinutes: Sentry documents both in minutes.
    • durationMs and avgDurationMs: Sentry stores these in milliseconds. The old markdown printed them as seconds.
  • Owner: owner is the display name, and ownerEmail is the owner's email when a user owns the monitor. A test asserts it comes through.
  • Stats: capped at the 10 most recent buckets, oldest first, and null when includeStats is false.
  • Fixtures: the monitor mock fixtures now use a plain crontab schedule string and ms-scale durations.
  • Tests: the monitor assertions in get-sentry-resource.test.ts now use structuredContent.
  • Errors and project-constraint checks are unchanged.

Review: ready, no must-fix. The should-fixes are applied: the *Minutes field names, the stats .describe() now says "at most 10 most recent buckets", and the fixture nits (crontab string, ms durations).

Tokens (pnpm run measure-tokens, description + inputSchema): 1051 → 1074 (+23). On the test fixture, the model-visible payload went from 474 markdown tokens to 594 JSON tokens (1.25x).

Checks (package-scoped, env -u SENTRY_AUTH_TOKEN):

  • pnpm run --filter @sentry/mcp-core generate-definitions
  • mcp-core tsc
  • full mcp-core vitest: 143 files passed, 2099 tests
  • root pnpm run lint

Root pnpm run tsc / test were not run, because the cloudflare build uploads source maps to Sentry. Evals were skipped (they need API keys).

Rebase note: sibling structured-output PRs also touch packages/mcp-core/src/toolDefinitions.json. If it conflicts, regenerate it with pnpm run --filter @sentry/mcp-core generate-definitions instead of hand-merging.

via @dcramer.

--

View Session [Sentry]

Return cron monitor details as structuredContent with a declared
outputSchema instead of handwritten markdown. Config, environments,
check-ins, and stat buckets are mapped explicitly, so passthrough fields
such as alertRule and extra config keys stay private.

Durations are labeled in milliseconds (Sentry's unit); the old markdown
printed them as seconds. The search_issues follow-up hint moves into the
tool description.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 5, 2026 10:56pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 5, 2026
Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@dcramer
dcramer merged commit 6bcc212 into main Nov 5, 2026
35 checks passed
@dcramer
dcramer deleted the feat/get-monitor-details-structured-output branch November 5, 2026 23:20

This branch was previously deployed

2 inactive deployments
Actions — 267dae3a Deployed Nov 5, 2026 by sentry-junior[bot] via eval #1664
Preview — 267dae3a Deployed Nov 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant