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. It answers who changed what; runtime events (scaling, probe failures) come from diagnose_workload.

Input 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

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

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/non-destructive, so safety is covered; the description adds real behavior: multi-name results are merged and sorted newest-first, platform events live in the `cpln` context, and default lookback is 7d. It does not mention pagination or result caps beyond the limit param, leaving a small gap.

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?

Front-loads the core purpose and the name/names decision before the filters, and every sentence carries signal. It is dense — the context and diagnose_workload points could be tightened — but nothing is wasted.

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?

With an output schema available, the description need not explain return values, and it already covers scoping, defaults, context switching, and the sibling boundary for an 11-parameter tool. Nothing an agent needs to call it correctly is missing.

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; the description goes further by explaining cross-parameter semantics (to is only valid with from; since is exclusive with from/to; gvc is required only for GVC-scoped kinds with name/names) and the merged-sorted behavior of `names`. These add meaning beyond the individual schema entries.

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?

Specific verb (Query) plus a precisely scoped resource (Control Plane audit trail for mutations on resources of one kind), with an explicit note that runtime events belong to diagnose_workload. An agent can separate this from diagnose_workload and search_control_plane without opening a schema.

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

Usage Guidelines5/5

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

States the omit-name/names default, when to use `names` for multi-resource audits, and names the alternative (diagnose_workload) for runtime events with the exact condition that selects it. Both when-to-use and when-not-to-use are spelled out.

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.