Skip to main content
Glama

export_audit_trail

Read-only

Export the safety audit trail as JSON or CSV with optional filters for date range, tool name, action type, and session ID.

Instructions

Export the safety audit trail as JSON or CSV.

        Enterprise feature. Returns the full audit log with optional filters
        for date range, tool name, action type, and session ID.

        Args:
            start_time: Unix timestamp lower bound (0 = no filter).
            end_time: Unix timestamp upper bound (0 = no filter).
            format: Output format, ``"json"`` or ``"csv"``.
            tool_name: Filter by MCP tool name.
            action: Filter by action: ``"executed"``, ``"blocked"``,
                ``"rate_limited"``, ``"auth_denied"``,
                ``"preflight_failed"`` or ``"dry_run"``.  Empty for all.
            session_id: Filter by agent session ID.
        

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": "export_audit_trail"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionNoFilter by action: ``"executed"``, ``"blocked"``, ``"rate_limited"``, ``"auth_denied"``, ``"preflight_failed"`` or ``"dry_run"``. Empty for all. Default: "".
formatNoOutput format, ``"json"`` or ``"csv"``. Default: "json".
end_timeNoUnix timestamp upper bound (0 = no filter). Default: 0.
tool_nameNoFilter by MCP tool name. Default: "".
session_idNoFilter by agent session ID. Default: "".
start_timeNoUnix timestamp lower bound (0 = no filter). Default: 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.5.1
    • changedInput schema / properties / action / description
      Previous value: -"Default: \"\"."New value: +"Filter by action: ``\"executed\"``, ``\"blocked\"``, ``\"rate_limited\"``, ``\"auth_denied\"``, ``\"preflight_failed\"`` or ``\"dry_run\"``.  Empty for all. Default: \"\"."
    • changedInput schema / properties / end_time / description
      Previous value: -"Default: 0."New value: +"Unix timestamp upper bound (0 = no filter). Default: 0."
    • changedInput schema / properties / format / description
      Previous value: -"Default: \"json\"."New value: +"Output format, ``\"json\"`` or ``\"csv\"``. Default: \"json\"."
    • changedInput schema / properties / session_id / description
      Previous value: -"Default: \"\"."New value: +"Filter by agent session ID. Default: \"\"."
    • changedInput schema / properties / start_time / description
      Previous value: -"Default: 0."New value: +"Unix timestamp lower bound (0 = no filter). Default: 0."
    • changedInput schema / properties / tool_name / description
      Previous value: -"Default: \"\"."New value: +"Filter by MCP tool name. Default: \"\"."
  2. Changed12 schema fields changedv1.5.0
    • removedInput schema / properties / action / default
      Removed value: -""
    • addedInput schema / properties / action / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / end_time / default
      Removed value: -0
    • addedInput schema / properties / end_time / description
      Added value: +"Default: 0."
    • removedInput schema / properties / format / default
      Removed value: -"json"
    • addedInput schema / properties / format / description
      Added value: +"Default: \"json\"."
    • removedInput schema / properties / session_id / default
      Removed value: -""
    • addedInput schema / properties / session_id / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / start_time / default
      Removed value: -0
    • addedInput schema / properties / start_time / description
      Added value: +"Default: 0."
    • removedInput schema / properties / tool_name / default
      Removed value: -""
    • addedInput schema / properties / tool_name / description
      Added value: +"Default: \"\"."
  3. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds the enterprise-tier requirement and states that the full audit log is returned, which is meaningful context. It says nothing about result size limits, truncation, pagination, or ordering for what could be a very large export.

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

Conciseness3/5

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

The first two sentences are well front-loaded and earn their place. The Args block, however, duplicates the input schema verbatim in raw docstring form with awkward indentation, bloating the description without adding information the agent doesn't already have.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter read-only export with no output schema, the definition covers purpose, tier gating, and filtering adequately. It leaves the agent guessing about the returned payload structure, export size limits, and how this differs from `export_audit_log`, which are the meaningful remaining gaps.

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 coverage is 100%, so every parameter is already documented, and the description's Args block largely restates those same definitions (including defaults being omitted). It adds no format syntax, timestamp granularity, or filter-combination semantics beyond the schema, so baseline 3 applies.

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?

The description opens with a specific verb and resource ('Export the safety audit trail') and names the output formats, so the agent knows exactly what the tool produces. It does not, however, distinguish itself from the sibling tool `export_audit_log`, which an agent could easily confuse with this one.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Enterprise feature' is a useful prerequisite, and the filter list implies the tool is for scoped retrieval of audit events. But there is no explicit when-to-use guidance, no statement of when not to use it, and critically no routing advice versus the near-identical sibling `export_audit_log`.

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

Deploy Server

Other Tools