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 and compliance checks.

Instructions

Retrieve persisted SWE-Gate patch evaluation records and violation findings by evaluation_id (EVL-...), or verify and inspect cryptographic SHA-256 hash-chained audit sessions in TraceKitStore by session_id (SES-...) with optional block listing (include_blocks, max_blocks). Use this for forensic inspection and compliance verification after running evaluate_patch or context tools. Pure read-only query with zero ledger mutations.

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 readOnlyHint, idempotentHint and destructiveHint=false, and the description reinforces this ('zero ledger mutations') while adding genuine context: SHA-256 hash-chain integrity verification and optional block enumeration. It does not note rate limits or failure modes for an invalid id, which keeps it short of 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?

Purpose is front-loaded in the first clause, followed by usage and then the read-only guarantee; every sentence earns its place. The two sentences are dense with parenthetical id formats, which slightly hurts scannability but not correctness.

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?

An output schema exists, all four parameters are documented in-schema, and annotations carry the safety profile, so the description need not explain return values. It covers the dual query modes, the optional block expansion, and the forensic use case, leaving nothing essential an agent would need.

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, but the description goes further by tying parameters to modes: evaluation_id versus session_id selection, and include_blocks/max_blocks as optional block listing for the session path. That mode-to-parameter mapping is value the schema alone doesn't express.

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 description names a specific verb (retrieve/verify/inspect) and two distinct resources: persisted SWE-Gate evaluation records by EVL id and hash-chained TraceKit audit sessions by SES id. It also distinguishes the two lookup modes, so an agent can tell which branch to take without opening the schema.

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?

It states the trigger context clearly: use for forensic inspection and compliance verification after running evaluate_patch or other context tools, explicitly referencing the sibling evaluate_patch. It does not state when NOT to use it versus siblings like resolve_context_bundle, but the intended post-evaluation workflow is unambiguous.

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