Skip to main content
Glama

caveat_find

Read-onlyIdempotent

Search past decision records for whether a decision was already made, on what grounds, and whether it still stands by matching query words across decisions and evidence.

Instructions

Search past decision records of one program for decisions already made: has this been decided before, on what grounds, and does it still stand? Each record is the events of one past run, replayed in a fresh session. A decision revision is found when every word of query occurs, ignoring case, in its decision or revision name, the record name, the names, sources and claims of the evidence it rests on, its caveats, or its retention reasons. Use caveat_explain to see one record in full, and caveat_dependents to trace one evidence forward. report (caveat-find/0.1) includes words, searched (per record: revisions and any fatal event) and found (per revision: record, value, status, grounds with sources, retained caveats, withdrawn evidence, history, outcome and where each word matched). exitCode: 0 searched, even when nothing matched; 1 an event failed fatally in a record (its decisions are of the session before it); 2 source load failure. 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>",
      "records": "<records>",
      "query": "<query>"
    },
    "name": "caveat_find"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesWords to find, separated by spaces, such as "refund email". Every word must match; case is ignored; a word matches part of a name, so refund matches refund_warranted.
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.
recordsYesPast records of the program, each {"name":"ticket-a","events":[...]}: a unique non-empty name the report uses, and the events of that run in order, as for caveat_explain. At most 64 records and 1 MiB of serialized UTF-8 JSON in all; each record at most 1,000 events.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.5.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare this read-only, idempotent, and non-destructive, and the description adds substantial behavior beyond them: exit code semantics (0 searched even with no matches, 1 fatal event with decisions from the prior session, 2 source load failure), the instruction to read exitCode even when isError is false, and the bridge-failure error envelope. It also discloses the fatal-event replay stop and the 64-record/1,000-event/1 MiB limits.

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 purpose, then the matching rule, then alternatives, then return/exit semantics — a sensible ordering. Information density is high with little repetition, but the report/exit-code paragraph is a long semicolon-chained run-on that is harder to scan than it needs to be.

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?

No output schema exists, so the description must carry the return contract, and it does: it specifies the exact JSON shape (schema, operation, sourceSha256, runtime, exitCode, report), what 'searched' and 'found' contain, and the separate error envelope. Nothing an agent needs to invoke this correctly or interpret the result 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 100%, so the baseline is 3. The description nonetheless adds real meaning: it enumerates exactly which fields the query words are matched against (decision/revision name, record name, evidence names, sources, claims, caveats, retention reasons) and explains the per-word, case-insensitive substring matching rule. Record semantics are clarified as replayed past runs from a fresh session with no carry-over history.

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 opening sentence states a specific verb (search) and resource (past decision records of one program) and frames the question it answers: has this been decided before, on what grounds, and does it still stand. It is clearly distinguishable from caveat_explain (full record view) and caveat_dependents (evidence tracing), which are both named.

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

Usage Guidelines4/5

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

Guidance is explicit about routing: 'Use caveat_explain to see one record in full, and caveat_dependents to trace one evidence forward,' which tells the agent which sibling to pick for the adjacent tasks. The replay model (each record is a past run replayed fresh, previous calls carry no history) also tells the agent what inputs are expected. No explicit 'do not use this when' exclusion is stated, which keeps it below a 5.

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