Skip to main content
Glama

get_audit

Read the admin-scoped audit log with paging, then narrow entries by time, action, result, target, or principal to investigate changes and denials.

Instructions

Read the audit log (admin-scoped), bounded to limit entries per page.

    Returns an ``AuditLogPage`` dict. Non-admin tokens get a structured
    ``forbidden`` (403) error.

    All filters compose with AND, and all are applied in SQL — narrowing is
    cheap, so prefer a filter over paging.
    

Input Schema

NameRequiredDescriptionDefault
limitNoMax entries in one page, clamped to [1, 200] before the call (the daemon rejects anything outside that range); omit for 50.
sinceNoKeep only entries at or after this inclusive ISO-8601 UTC timestamp (``2026-08-07T10:00:00Z``); omit for no lower bound.
untilNoKeep only entries at or before this inclusive ISO-8601 UTC timestamp (``2026-08-07T10:00:00Z``); omit for no upper bound.
actionNoKeep only entries whose action equals this exactly (e.g. ``deploy.create``); omit for every action, or use ``action_prefix`` for a family.
cursorNoOpaque paging cursor from the previous page's response; omit for page 1.
resultNoKeep only entries with this outcome — ``ok``, ``error``, ``denied`` or ``replay``; omit for all four.
targetNoKeep only entries acting on this exact target id (e.g. a service name); omit for every target.
target_typeNoKeep only entries whose target is of this type (e.g. ``service``, ``model``); omit for every type.
principal_idNoKeep only entries written by this token id — everything that caller did; omit for every principal.
action_prefixNoKeep only actions starting with this **literal** prefix, never a pattern (``deploy.`` matches deploy.create, deploy.git_create, deploy.plan). Grammar ``[a-z0-9._]``, 1-40 chars, else ``bad_request``; omit for every family.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does well: it discloses the admin requirement, that non-admin tokens get a structured 403 "forbidden" error, that it returns an AuditLogPage dict, and that filtering happens in SQL. It does not state result ordering or default sort, which matters for a log-reading tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short paragraphs, front-loaded with the verb, resource and scope; the operational advice about filtering over paging comes last where it belongs. No sentence repeats the schema, and the RST-style backticks are the only minor friction.

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?

For a ten-parameter read tool with no output schema, the description supplies the return type, the auth failure mode, and the filter-composition rule. The remaining gap is ordering/pagination behavior across pages, which the cursor parameter hints at but the description never explains.

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 per-param meaning is already covered and a 3 would be the floor. The description still adds value beyond the schema by explaining that all filters compose with AND and are applied server-side, which tells the agent how to combine the ten optional filters rather than just what each one does.

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 resource ("Read the audit log") plus the key scoping constraint ("admin-scoped") and paging bound. It's clear what it does, but it never distinguishes itself from the closest sibling, get_events, which an agent could easily confuse with it.

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?

Gives real usage direction: admin token required, filters compose with AND, and "narrowing is cheap, so prefer a filter over paging" is actionable advice about how to call it. It stops short of naming alternatives (e.g. get_events) or saying when not to use this tool.

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