Skip to main content
Glama

ZeroWidth Ledger

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

TableJSON 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.6/5.0
Behavior4/5

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

Goes well beyond annotations by disclosing the not_found failure mode, the createIfMissing side effect (minting a measure vs event metric based on labels), and the cross-cutting effect that readings land as evidence on open decisions bound to the metric. Also flags a possible needs_confirmation return. The only untold part is idempotent behavior details, which the schema already covers.

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-loads the core action and then packs error handling, creation flow, and side effects into dense parentheticals. Every clause carries information, though the single paragraph is heavy and would benefit from light separation.

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?

With 9 params, 89% schema coverage, nested labels, an annotation set, and no output schema, this description covers the required workflow (resolve-or-create), the event/measure distinction, and a non-obvious cross-tool side effect. Nothing an agent needs to invoke it correctly is missing.

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 high (89%), so baseline is 3, but the description adds real meaning: metricId accepts an id or slug and what happens on unknown values, and labels imply event-kind semantics vs a measure. This clarifies parameter interplay the schema states only in fragments.

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?

States a specific verb and resource ('Record one observation of a tracked metric'), which cleanly separates it from sibling read/create/list/archive metric tools. The scope is precise and an agent can identify its role 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?

Explicitly routes the agent: check ledger_metrics_list for the id/slug, use ledger_metrics_create to make one, or pass createIfMissing to mint inline. It also gives a triggering condition ('when a user reports a number... offer to record it') and the event-metric invocation pattern (omit value).

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