Skip to main content
Glama

caveat_explain

Read-onlyIdempotent

Replay optional events and explain resulting decisions, evidence, and displayed values so you can answer why a decision was made.

Instructions

Replay optional events and explain the resulting decisions, evidence and displayed values. Use to answer why a decision was made; choose caveat_dependents to trace one evidence or caveat name forward, and caveat_test for assertions. report (caveat-explain/0.1) includes sequence, event outcomes, decisions with grounds and revision history, evidence with caveats, displayed values and available archive history. exitCode: 0 replay completed (may include rejected events); 1 fatal event with last good state; 2 source load failure (report has loads:false and error). Returns the same JSON in structuredContent and text: {schema:"caveat-authoring/0.1",operation,sourceSha256,runtime,exitCode,report}. Read exitCode even when isError is false. Bridge failures instead set isError:true with {schema:"caveat-authoring-error/0.1",error:{kind,message}}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventsNoEvents replayed in array order from a fresh session. Omitted or [] inspects the initial state; previous calls supply no history. Rejections are recorded and replay continues; a fatal event stops replay at the last good snapshot. At most 1,000 entries and 1 MiB of serialized UTF-8 JSON.
sourceYesComplete inline Caveat program text, available as the virtual file inline.cav. No file path or URL lookup. At most 1 MiB of UTF-8 source; each call uses a fresh runtime.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.1
    • addedInput schema / properties / events / description
      Added value: +"Events replayed in array order from a fresh session. Omitted or [] inspects the initial state; previous calls supply no history. Rejections are recorded and replay continues; a fatal event stops replay at the last good snapshot. At most 1,000 entries and 1 MiB of serialized UTF-8 JSON."
    • addedInput schema / properties / events / items / description
      Added value: +"One event to dispatch to the supplied program, for example {\"event\":\"read\",\"payload\":{\"value\":85}} when source declares read with a value parameter."
    • addedInput schema / properties / events / items / properties / event / description
      Added value: +"Event name declared in source, such as read or assess. Supply the name only, without Caveat syntax."
    • addedInput schema / properties / events / items / properties / payload / description
      Added value: +"Values keyed by the event parameter names declared in source, for example {\"value\":85}. Omit for an empty payload ({}). The runtime checks parameter names, types and declared bounds."
    • changedInput schema / properties / source / description
      Previous value: -"Inline Caveat source; no file or URL lookup."New value: +"Complete inline Caveat program text, available as the virtual file inline.cav. No file path or URL lookup. At most 1 MiB of UTF-8 source; each call uses a fresh runtime."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, yet the description adds substantial non-obvious context: exitCode 0/1/2 semantics (including that rejected events still yield 0), the warning to 'Read exitCode even when isError is false', and the fact that bridge failures use a different error schema with isError:true. That is exactly the behavior an annotations-only view would miss.

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?

Purpose and routing come first, followed by report contents, exitCode meanings, and return/error shapes — a sensible front-loaded order with no filler sentences. It is dense, and the single packed paragraph would scan better broken into segments, but each sentence carries distinct information.

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, so the description must describe returns — and it does: the caveat-explain/0.1 report fields (sequence, event outcomes, decisions with grounds and revision history, evidence, displayed values, archive history), the identical structuredContent/text payload shape, and the caveat-authoring-error/0.1 error envelope for bridge failures.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents 'source' (inline Caveat text, 1 MiB limit) and 'events' (order, payload keying, 1000-entry limit) in detail. The description adds only the framing that events are optional and replayed from a fresh session; baseline 3 is appropriate when the schema carries the parameter burden.

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: 'Replay optional events and explain the resulting decisions, evidence and displayed values.' It also names the distinguishing scope against siblings ('choose caveat_dependents to trace one evidence or caveat name forward, and caveat_test for assertions'), so an agent can separate it from the other caveat_* tools without opening a 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?

'Use to answer why a decision was made' gives the triggering intent, and the same sentence routes to two named alternatives with the condition that selects each. When-to-use and when-to-use-something-else are both explicit.

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