Skip to main content
Glama

query_audit_ledger

Read-onlyIdempotent

Retrieve SWE-Gate patch evaluation records and violation findings by evaluation ID, or verify SHA-256 hash-chained audit sessions by session ID for forensic inspection and compliance checks.

Instructions

Retrieve persisted SWE-Gate patch evaluation records and violation findings by evaluation_id (EVL-<16 lowercase hex chars>), or verify cryptographic SHA-256 hash-chained audit sessions in TraceKitStore by session_id (SES-...) with optional block pagination (include_blocks default true, max_blocks 1..256 default 50); at least one of evaluation_id or session_id must be provided. Use this for forensic inspection and compliance verification after running evaluate_patch or context tools.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "query_audit_ledger"
  }
}

Input Schema

NameRequiredDescriptionDefault
max_blocksNoMaximum number of audit blocks to return when `include_blocks` is true (1 to 256)
session_idNoTraceKit session identifier (`SES-...`) to verify SHA-256 hash chain integrity and inspect blocks
evaluation_idNoSWE-Gate evaluation identifier (`EVL-<16 lowercase hex chars>`) returned by `evaluate_patch`
include_blocksNoWhether to include individual hash-chained audit block records when querying `session_id`

Output Schema

NameRequiredDescriptionDefault
contentYesJSON-serialized audit ledger query and cryptographic chain verification report
isErrorYesTrue if neither identifier was provided, parameters failed validation, or no matching audit record was found

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.8.3

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. Beyond that the description discloses that sessions are cryptographically hash-chained and that verification is a primary operation, plus the cross-field requirement that at least one identifier be supplied. It does not discuss failure modes for a broken hash chain or error behavior, so not a 5.

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?

The definition is front-loaded with the verb and resource, and the semicolon-separated clauses each carry distinct information about modes, constraints, and pagination. It is somewhat dense as a single long sentence and repeats defaults already present in the schema (`include_blocks` true, `max_blocks` 1..256/50), which is minor waste.

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?

Given an output schema exists (so return values need not be described) and full schema coverage, the description still supplies everything an agent needs: the two identifier formats, mode selection, the at-least-one constraint, pagination behavior scope, and when the tool is used. Nothing essential is missing for a two-mode forensic query tool.

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% and the schema itself states defaults and ranges, so much of the parameter text is restatement (baseline 3). However, the description adds a genuine non-schema constraint — at least one of `evaluation_id` or `session_id` must be provided — and clarifies ID formats and that pagination only applies to session queries, which is real added meaning.

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 specific verbs (retrieve, verify) against specific resources (SWE-Gate patch evaluation records, violation findings, SHA-256 hash-chained audit sessions) and distinguishes two lookup modes by identifier type. It also names the sibling `evaluate_patch` as the producer of the evaluations, so an agent can separate this from the evaluate/prune/resolve siblings without opening schemas.

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?

Provides clear timing context: 'Use this for forensic inspection and compliance verification after running `evaluate_patch` or context tools.' That informs when the tool is relevant, but there is no explicit exclusion or comparison against other retrieval alternatives, 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.