Skip to main content
Glama

Record a metric reading

ledger_metrics_record_reading

Record one observation of a tracked metric. metricId accepts a metric id OR its snake_case slug from ledger_metrics_list; an unknown one is a not_found error — check ledger_metrics_list, create it with ledger_metrics_create, or pass createIfMissing: true to mint a "measure" metric at that slug in the same call (an "event" metric when the reading carries labels). The reading automatically lands as evidence on every open decision whose prediction is bound to this metric — so when a user reports a number ("triage is down to 12 minutes"), offer to record it. For event-kind metrics, omit value to count one occurrence. May return needs_confirmation.

Input Schema

NameRequiredDescriptionDefault
atNoISO timestamp the reading is for. Defaults to now; set it when backfilling an earlier reading.
keyNoIdempotency key (e.g. "2026-w32") — a repeat write with the same key returns the original reading instead of doubling the series. Use for scheduled/recurring recordings. The key is per set of labels, so one key per day can cover every country.
noteNoWhere the number came from, if worth recording.
valueNoThe observed value, in the metric's unit. Omit for event-kind metrics to record one occurrence.
labelsNoEvent metrics only. What this count is broken down by, e.g. { country: "DE", plan: "pro" } — snake_case names, string values. Lets the metric be read and claimed by slice later. Refused on a measure.
metricIdYesMetric id or slug (from ledger_metrics_list).
workspaceNoWorkspace slug. Personal tokens with no default workspace MUST pass this; tokens with a default can override per call. Ignored for workspace API keys.
approvalIdNo
createIfMissingNoMint the metric when the slug is unknown. Default false — an unknown slug is an error, so a typo can't quietly start a second series.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare it is a non-read-only, non-destructive write. The description adds substantive behavior beyond that: the reading auto-lands as evidence on every open decision bound to the metric, unknown slugs produce not_found rather than silently creating a series, and the call may return needs_confirmation. These are the side effects an agent must anticipate.

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?

Front-loaded with the core action, then resolution guidance, then the evidence/confirmation behavior. It is dense and parentheses-heavy but every sentence carries operational value; no filler or restatement of the title.

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

Completeness4/5

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

No output schema exists, yet the description covers the important return behaviors (evidence attachment, needs_confirmation). For a 9-parameter mutation with nested labels, this is near-complete, though it does not tell the agent what needs_confirmation means for a subsequent retry.

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

Parameters4/5

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

Schema coverage is already 89%, so the baseline is 3. The description still adds real semantics over the schema: metricId accepts an id or a snake_case slug, createIfMissing mints a 'measure' metric (or 'event' when labels are present), and labels presence switches metric kind. That cross-parameter interaction is not evident from the schema alone.

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?

Specific verb ('Record one observation of a tracked metric') and clearly scoped resource, distinguishing it from ledger_metrics_create/list which it explicitly names for adjacent purposes. An agent immediately knows this writes a single data point rather than defining or reading a metric.

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?

Explicit routing: use ledger_metrics_list to find a slug, ledger_metrics_create to mint one, or pass createIfMissing to do both, plus the not_found behavior on an unknown slug. It also states the trigger condition ('when a user reports a number ... offer to record it') and the event-metric near-alternative (omit value to count an occurrence).

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.

Resources