Skip to main content
Glama

Verify Contract Baseline

verify_contract
Read-onlyIdempotent

Audit on-disk pointer files against a contract's SHA-256 baseline or committed snapshot before or after code tasks, confirming consistency without changing state.

Instructions

Read-only pre-flight and post-completion consistency check (ADR-0004 / ADR-0006 / ADR-0007): audits on-disk pointer files against the contract's SHA-256 baseline or committed post-mutation snapshot.

Behavior & Side Effects

  • Zero side effects: Pure read-only operation. Never updates SQLite state and never consumes a TOCTOU strike.

  • Track-aware verification:

    • Read-only tasks & CLAIMED write_mode="proposal" contracts: checks immutable baseline SHA-256.

    • CLAIMED write_mode="direct" mutation contracts: checks path safety & file existence while reporting modified files.

    • COMPLETED mutation contracts: verifies on-disk files against committed verified_sha256.

Return Value

Returns { ok: true, valid, fulfillable, contract_id, status, target_agent, toctou_strike, max_toctou_strikes, dirty_files, remediation?, 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": {
      "contract_id": "<contract_id>"
    },
    "name": "verify_contract"
  }
}

Input Schema

NameRequiredDescriptionDefault
agent_idNoOptional caller agent identifier for audit logging. Does not restrict read-only verification.
claim_tokenNoOptional lease token for caller verification (FC-301).
contract_idYesThe contract ID whose on-disk pointer files should be verified against the baseline SHA-256 snapshot without mutating contract state.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.2
    • addedInput schema / properties / claim_token
      Added value: +{
      +  "description": "Optional lease token for caller verification (FC-301).",
      +  "maxLength": 128,
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. Addedv0.3.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the bar is lower, yet the description adds real value: it guarantees zero SQLite writes and no TOCTOU strike consumption, and it enumerates exactly what is compared in each contract state. That is precisely the behavior an agent cannot infer from the annotations alone.

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?

Header-segmented and front-loaded with the core definition, with behavior and return value in separate clearly labeled blocks. The ADR-0004/0006/0007 citations are opaque identifiers that consume space without informing an agent, and the fully expanded return object is slightly verbose, but overall the text earns its length.

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?

With no output schema, the description correctly takes on the burden of describing the return object, and it covers side effects and per-state verification semantics thoroughly. Gaps remain around failure conditions: what causes ok=false versus valid=false versus fulfillable=false, and how remediation should be acted on, are not explained.

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% and each of the three parameters is documented in the schema, including the optionality of agent_id and claim_token. The description adds nothing parameter-specific beyond what the schema states (e.g., it never clarifies when claim_token is required versus optional). Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and object: a read-only consistency check that audits on-disk pointer files against the contract's SHA-256 baseline or a post-mutation snapshot. The 'pre-flight and post-completion' framing makes the scope clear. It never names a sibling tool to contrast with, but the function is distinct enough from the mutation tools in the catalog that an agent can identify it without ambiguity.

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?

The track-aware section effectively tells the agent when each verification mode applies (read-only tasks, CLAIMED proposal, CLAIMED direct, COMPLETED), which is better than most usage guidance. However, it never excludes anything or tells the agent which alternative to reach for when verification is not what is wanted (e.g., inspect_mesh_state), so the routing guidance is contextual rather than explicit.

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