Skip to main content
Glama

audit_brief

Generate a budgeted session digest for auditors, preserving verbatim user turns and tool/file activity within a strict character limit.

Instructions

Token-lean, budgeted session digest for auditors — the audit_brief preset.

One call answers "what happened in this session, verbatim where it matters", inside a hard character budget. A preset over the existing core, not a second engine (project preset rule): ONE query scan over the session's events supplies the user turns (VERBATIM — the auditor's ground truth) and the tool/file footprint (folded by aggregate(group_by="tool_kind") + the edit/write rows' existing file refs); the plan/plan_feedback projections supply the decision trail; :mod:ai_r.tokens (the same SSOT behind session_stats(with_tokens) / read_session(with_tokens)) supplies the token breakdown.

Deterministic budget algorithm: build the full digest, then tighten in a FIXED ladder until the serialized JSON fits budget_chars (default 15000; 0 = unlimited) — (1) drop tool-call error details, (2) drop the per-file edit list, (3) drop plan bodies + feedback quote/comment texts (counts/references always stay; bodies on-demand via get_body). User turns are NEVER truncated: if they alone exceed the budget the response carries budget.over_budget: true + a note naming the full projections — never a silently clipped ground truth.

session accepts the full uuid or a unique id prefix (e.g. the 8-hex head), resolved through the SAME id-prefix matching locate uses — the digest's session.uuid echoes the full resolved id; an ambiguous prefix is invalid_argument naming the candidates (capped), zero matches is not_found with closest-title suggestions. agent is an optional hint (None = the id resolves across every parser, like read_session). redact=true (default) masks secrets in the emitted title / user texts / plan bodies / feedback pairs. The response is section-structured (session / user_turns / plans / tools / files / tokens / component_tokens / budget); the CLI mirror is ai-r audit-brief <uuid> (markdown, --json for this dict).

Thin wrapper over :func:ai_r.audit_brief.audit_brief: a ValueError becomes {"error": "invalid_argument"}, an unknown session id {"error": "not_found"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agentNo
redactNo
sessionYes
budget_charsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description carries full behavioral burden and succeeds: it discloses the deterministic budget algorithm, the fixed truncation ladder, that user turns are NEVER truncated, error handling for invalid/ambiguous prefixes, redaction behavior, and the response structure. This is far beyond basic expectations.

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 description is long but front-loaded with a clear purpose and well-organized into sections with bullets. Every sentence provides useful detail, though there is slight redundancy (e.g., mentioning both 'preset' and 'thin wrapper') that could be trimmed without losing meaning.

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 the tool's complexity, the description is remarkably complete: it covers all parameters, behavioral edge cases, error mapping, output sections, and even the CLI mirror. The presence of an output schema doesn't reduce the need for this context because the tool's behavior around budgets and redaction is essential for correct invocation.

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 description coverage is 0%, but the description thoroughly explains all four parameters: session accepts full UUID or prefix, agent is an optional hint, redact masks secrets, and budget_chars drives the truncation algorithm. It adds operational meaning well beyond the bare schema definitions.

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 clearly states the tool's purpose as a 'Token-lean, budgeted session digest for auditors' and explains it answers 'what happened in this session, verbatim where it matters'. It distinguishes itself from siblings by labeling itself a preset over the core, not a second engine, and by detailing its specific output structure.

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 description specifies the intended use case ('for auditors') and clarifies it is a 'preset over the existing core' with a budget algorithm. However, it does not explicitly state when to prefer this over alternatives like read_session or session_stats, nor does it provide exclusions or alternative guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pro-target/ai-r'

If you have feedback or need assistance with the MCP directory API, please join our Discord server