Skip to main content
Glama

caveat_dispatch

Read-onlyIdempotent

Dispatch new events to a Caveat program while preserving a running ledger across calls: pass the returned save back unchanged with the same source.

Instructions

Keep one running ledger across calls: send events to the program, starting fresh or from the save an earlier caveat_dispatch call returned, and get the new save back. Use when a task records decisions as it goes; pass report.save unchanged as save in the next call, with the same source, and send only the new events. The server keeps nothing between calls. caveat_explain instead replays a whole history from the start each time. report (caveat-dispatch-step/0.1) is the caveat-explain/0.1 report of the state after these events (its events list only this call's events), plus restored and save. exitCode: 0 completed (may include rejected events); 1 fatal event, with the explanation and save of the last good state; 2 source load failure, or a save that does not restore with this exact source (report has 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}}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "source": "<source>"
    },
    "name": "caveat_dispatch"
  }
}

Input Schema

NameRequiredDescriptionDefault
saveNoOptional. The report.save text from the previous caveat_dispatch call, passed back unchanged. Omit to start a fresh session. A save restores only with the exact source it came from; it is not repaired or checked for history. At most 2 MiB of UTF-8.
eventsNoEvents to send in array order after the save is restored, or from a fresh session. Omitted or [] reports the current state and returns an equivalent save. Rejections are recorded and the step continues; a fatal event stops it at the last good state. 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.
moduleBindingsNoOptional, only with save, and only after a call refused that save because it needs this. A save that a release up to 1.4.1 wrote, of a bundle whose modules use hold or release, can need its reading named: scoped reads the bundle as a fresh session does, each module's hold and release its own; legacy-hold-capture reads it as releases 1.2.0 to 1.4.1 did, where a hold or release two words before because names the root module's declaration. Name the reading of the release that wrote the save. A save this tool returns names its reading, so later calls omit this; a choice that differs from the save's own is refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.5.0

TDQS

A4.9/5.0
Behavior5/5

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

With readOnlyHint/idempotentHint already covering the safety profile, the description adds substantial context beyond annotations: "The server keeps nothing between calls" (clarifies why readOnly is consistent), the full exitCode contract (0 completed with possible rejections, 1 fatal with last-good-state save, 2 source/save mismatch), the instruction to read exitCode even when isError is false, and the isError bridge-failure shape. This is exactly the non-obvious behavior an agent needs.

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 is front-loaded, then the alternative, then the return/exitCode contract — a sensible order with no filler sentences. It is dense and semicolon-heavy in a single block, which slows scanning slightly, but every clause carries information an agent needs to call it correctly.

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 carries the full return burden and does: it describes the {schema, operation, sourceSha256, runtime, exitCode, report} envelope, what report contains (caveat-explain/0.1 shape plus restored and save), and the error envelope. For a stateful, multi-call tool with size limits and version quirks, nothing essential is missing.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds cross-call meaning the schema cannot: save must be passed back unchanged with the same source, and each call uses a fresh runtime. The distinction between rejected events (recorded, step continues) and fatal events (stops at last good state) gives the events array semantics beyond its schema text.

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: send events to the program against a carried-over ledger, returning the new save. It also explicitly separates itself from caveat_explain ("replays a whole history from the start each time"), so an agent can choose without opening either 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?

Gives a positive trigger ("use when a task records decisions as it goes"), a concrete usage pattern (pass report.save unchanged as save, keep the same source, send only new events), and names the alternative tool and why you would pick it. When-to-use and when-to-use-something-else are both covered.

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