Skip to main content
Glama

discover_monitors_reconcile

Destructive

Turn a scan of a repository or a host into monitors: send every scheduled job you found, get back a diff of what was created, what already existed and what has gone missing. This is how a user gets monitored without filling in a form. PROPOSE, THEN ASK. Show the user what you found and get their agreement BEFORE calling this — it CREATES monitors. Eleven monitors created on a repository you were asked to look at are eleven things that can page a person at 03:00 and that they never agreed to, and this endpoint has no delete path to undo them with. WHAT TO SEND: a JSON array as a string in sources, one entry per job. Each entry needs source_kind and source_ref — that pair is the key this call diffs against, so source_ref must be STABLE between scans; a ref whose shape changes makes every monitor look new and duplicates the whole fleet on the next run. Kinds: 'crontab' (crontab -l, /etc/cron.d/, /etc/crontab), 'github-actions' (.github/workflows/.yml, an on.schedule.cron entry), 'k8s-cronjob' (a manifest or Helm template with kind: CronJob and a spec.schedule), 'systemd-timer' (/etc/systemd/system/*.timer, an OnCalendar= line). Send schedule_cron only when you actually read a cron expression; a workflow triggered on push has no cadence to be late against, and an invented one pages the user every quiet afternoon. Without it the monitor is created on-demand instead. READ THE TIMEZONE, DO NOT ASSUME ONE. crontab and systemd-timer fire in the HOST's local time; github-actions and k8s-cronjob evaluate their schedules in UTC. A 'crontab' or 'systemd-timer' entry carrying a schedule_cron MUST state its tz, and the zone must be READ from the host — timedatectl show -p Timezone --value, or readlink /etc/localtime where that is unavailable — not filled in as a default. A host at UTC+4 running '0 3 * * *' pings at 23:00 UTC, so a monitor recorded as tz=UTC arms its deadline about twenty hours before the job is due and opens a false incident every single day. The API cannot catch this for you: it requires that a zone be STATED, and a stated 'UTC' from a scanner that read the host is indistinguishable on the wire from a stated 'UTC' a client filled in. Send 'UTC' only when you read the host and it really is UTC. Scanning a REPOSITORY, where there is no host to read, ASK THE USER which zone those machines run in — not knowing is a question to put to them, never a reason to reach for a default. WHAT COMES BACK is a three-way diff: created (sources that had no monitor and now have one), existing (sources already monitored, returned COMPLETELY UNMODIFIED — not the name, not the schedule, not the thresholds, so an expect_every_s the user tuned by hand survives every scan), and orphaned (monitors whose source this scan did NOT report). RECONCILE NEVER DELETES, NEVER PAUSES AND NEVER EDITS ANYTHING. There is no delete path and no update path in this endpoint at all, so an orphaned monitor is still running and still alerting; treat that list as a question for the user ('this job is gone, should its monitor go too?'), never as something to act on yourself. BECAUSE OF THAT IT IS SAFE TO RE-RUN, and re-running is the point: run it nightly, on every CI build, after every deploy, and the second run creates only what has appeared since the first while orphaned becomes your drift report. A scan that runs once is a setup wizard; a scan that is safe on a schedule is drift detection. Existing monitors already carry source_kind and source_ref in list_monitors, so you can see what is already discovered without calling this.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourcesYesThe complete scan result: a JSON ARRAY supplied as a string, one entry per scheduled job, e.g. '[{"source_kind":"crontab","source_ref":"/etc/cron.d/backup:/usr/local/bin/backup.sh","name":"nightly backup","schedule_cron":"0 3 * * *","tz":"Europe/Berlin"}]'. Fields per entry: source_kind and source_ref (both REQUIRED — an entry missing either cannot be matched against an existing monitor and would be re-created on every scan), name (optional display name; falls back to source_ref), schedule_cron (optional 5-field cron expression, sent only when you actually read one), tz (the IANA zone that cron fires in — REQUIRED for a crontab or systemd-timer entry carrying a schedule_cron, read from the host, never guessed), and suggested_expect_every_s (optional; state the silence floor outright when you know the real cadence better than the cron expression does — it WINS over the value derived from the cron). Send the WHOLE scan in one call: this is a diff, so a source you leave out is reported as orphaned rather than ignored. Send '[]' to report that the scan found nothing — every discovered monitor is then listed as orphaned, and none of them is deleted. At most 1000 entries per call, each source_kind/source_ref pair at most once (a duplicate is rejected outright, not merged), and the project's 100-monitor cap is applied to the whole batch at once — if the batch would exceed it, NOTHING is created. Nothing is written unless every entry validates: one bad entry rejects the entire payload and leaves no monitors behind.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description directly contradicts the annotation idempotentHint=false. It repeatedly says the tool is safe to re-run and that the second run creates only what has appeared since the first, which is an idempotent effect. Even though the rest of the description is richly transparent about creation, no-delete behavior, and batch validation, this contradiction makes the annotation and description provide conflicting expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well structured and front-loaded with the core purpose and the consent warning, and the length is largely justified by the tool's stakes. It is not maximally concise: the no-delete/safety point is repeated several times and some rhetorical lines (e.g., 'setup wizard vs drift detection') are not strictly necessary, but the organization makes the detail navigable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, yet the description fully explains the return shape (`created`/`existing`/`orphaned`), the meaning of orphaned monitors, the absence of delete/update paths, the monitor cap applied to the whole batch, and how to see existing discovery via list_monitors. An agent has everything needed to invoke the tool safely, aside from the contradictory idempotency annotation already penalized.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already covers `sources` at 100%, and the description goes well beyond it: it explains stable source_ref requirements, per-kind source_ref shapes, when schedule_cron may be omitted, that tz must be read from the host or asked from the user, duplicate rejection, the 1000-entry limit, and the all-or-nothing validation behavior. This is substantial added meaning, not schema repetition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: turn a scan of a repository or host into monitors by sending scheduled jobs and getting back a diff. It clearly names the source kinds and distinguishes this tool from the manual create-monitor flow, so an agent can tell what it does without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says when to use the tool (after scanning, nightly, on CI builds, after deploys), when not to use it (without user agreement; never to act on orphaned monitors), and points to list_monitors as the way to see what is already discovered. The 'PROPOSE, THEN ASK' instruction and the timezone-asking rule are concrete, actionable usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A3.7/5.0
Disambiguation4/5

Tools are organized by clear resource domains, and the long descriptions carefully separate similar reads. The main ambiguity is create_monitor's upsert behavior overlapping with update_monitor, and list_incidents vs list_open_incidents could be confused from names alone.

Naming Consistency4/5

Almost every tool uses verb_noun snake_case with a consistent CRUD vocabulary like create_, list_, get_, update_, and delete_. Minor deviations exist: get_alert_templates is really a list operation, and discover_monitors_reconcile is an awkward verb-object-verb construction.

Tool Count2/5

Thirty-six tools is a heavy surface for an agent to navigate, even for a full monitoring platform. Most tools are individually purposeful, but the count exceeds the range where an agent can quickly scan and select, and the set would be easier to handle if split across domains.

Completeness4/5

Coverage is strong: monitors, destinations, agents, status pages, API keys, routes, alert templates, incidents, run history, discovery, and Terraform export all have read and lifecycle operations. Minor gaps remain, such as no explicit single-incident view and no acknowledgment/resolution action beyond notes, but core workflows have no dead ends.