Skip to main content
Glama

Query Audit Events

query_audit_events
Read-onlyIdempotent

Query the Control Plane audit trail for mutations on one or more resources of the same kind. Omit name and names to fetch every event for that kind in the org. Supply names to audit multiple resources in one call (events are merged and sorted newest-first). Supports filtering by subject, audit context, and time range. Platform events live in the built-in cpln context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoEnd time — ISO 8601 OR a relative duration meaning that long ago (units m/h/d/w/mo/y; months are "mo"). Only valid with `from`.
gvcNoGVC name. Required when `kind` is GVC-scoped (workload, identity, dbcluster, volumeset) AND `name`/`names` is provided.
orgNoOrganization slug.
fromNoStart time — ISO 8601 (e.g. "2025-10-23T07:00:00Z") OR a relative duration meaning that long ago (units m/h/d/w/mo/y; months are "mo", e.g. "3mo"). Overrides `since`.
kindYesResource kind to query audit events for — singular, exact spelling (e.g., "workload", "secret", "policy", "identity", "auditctx", "gvc"). With a custom `context`, kind instead matches the arbitrary `resource.type` your workload wrote (e.g., "order").
nameNoSingle resource name. Mutually exclusive with `names`. Omit both to query every resource of that kind in the org.
limitNoMaximum events to return in the merged result (default: 50, max: 1000).
namesNoMultiple resource names to audit in one call. Merges events from all named resources, sorted newest-first. Max 25 names. Mutually exclusive with `name`.
sinceNoRelative lookback window from now (default: "7d"). Examples: "1h", "24h", "7d", "30d". Mutually exclusive with from/to.
contextNoAudit context name (default: "cpln"). Use a custom context name to query workload-written events.
subjectNoFilter by subject: user email (contains "@"), full link (starts with "/"), or bare service-account name (auto-resolved to /org/{org}/serviceaccount/{name}).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
dataNoThe full result. Read this, not only the summary.
detailsNo
summaryYes
nextStepsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed24 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / context / minLength
      Removed value: -1
    • removedInput schema / properties / from / maxLength
      Removed value: -40
    • removedInput schema / properties / gvc / minLength
      Removed value: -1
    • removedInput schema / properties / kind / minLength
      Removed value: -1
    • removedInput schema / properties / name / minLength
      Removed value: -1
    • removedInput schema / properties / names / items / minLength
      Removed value: -1
    • removedInput schema / properties / names / maxItems
      Removed value: -25
    • changedInput schema / properties / org / description
      Previous value: -"Organization slug (lowercase kebab-case). NEVER guess — if the user has not named one, ask. On org-not-found, stop and ask; do not retry variants."New value: +"Organization slug."
    • removedInput schema / properties / org / maxLength
      Removed value: -63
    • removedInput schema / properties / org / minLength
      Removed value: -1
    • removedInput schema / properties / org / pattern
      Removed value: -"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$"
    • removedInput schema / properties / since / maxLength
      Removed value: -20
    • removedInput schema / properties / subject / minLength
      Removed value: -1
    • removedInput schema / properties / to / maxLength
      Removed value: -40
    • changedInput schema / required
      Previous value: -[
      -  "org",
      -  "kind"
      -]New value: +[
      +  "kind"
      +]
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / properties / data / description
      Previous value: -"The full machine-readable result — list rows, the resource object, query results. Read THIS, not just the summary."New value: +"The full result. Read this, not only the summary."
    • addedOutput schema / properties / details
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / nextSteps / description
      Removed value: -"Recommended follow-up actions for this task, in order."
    • removedOutput schema / properties / ok / description
      Removed value: -"Whether the call succeeded."
    • removedOutput schema / properties / summary / description
      Removed value: -"One-line summary of the result."
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover readOnly, idempotent and non-destructive. The description adds genuine behavioral context beyond them: it only surfaces mutation events, multi-name results are merged and sorted newest-first, and platform events live in the built-in cpln context. Gaps remain on pagination/result shape, but that is partly covered by the output schema.

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?

Five tight sentences, front-loaded with the core action and scope before the parameter-behavior details. No filler, though the final sentence about platform events reads slightly as an appended note rather than an integrated point.

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?

With annotations covering safety and an output schema covering return values, the description supplies what an agent needs: scope, defaults for omission, multi-resource merge semantics, and context selection. The only missing piece is routing guidance against the adjacent events/audit-adjacent siblings.

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 description coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema: it explains the name/names mutual exclusion and the omit-both broadening behavior, plus the distinct roles of the cpln context vs custom contexts. It does not add syntax detail for from/to/since beyond what the schema already carries.

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 (Query) and resource (Control Plane audit trail for mutations) with clear scope: one or more resources of the same kind. This is unambiguous about what it returns, though it never differentiates itself from the nearby sibling get_workload_events, which an agent could plausibly confuse with audit events.

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?

Explains how to broaden or narrow the query via name/names omission, which is useful context, but gives no when-to-use guidance relative to alternatives such as get_workload_events, query_metrics, or search_control_plane. Usage is implied rather than stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.