Skip to main content
Glama

Query Audit

query_audit
Read-onlyIdempotent

Advanced audit query. source='events' queries action/time/target audit events (for normal users prefer memory_activity); source='consolidation' inspects consolidation/lifecycle/reflection audit records (admin). Consolidates the legacy query_audit_events/query_consolidation_audit tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return.
scopeNoOptional scope that narrows memory access; leave blank for the token default.
sinceNoRFC 3339 timestamp with timezone offset (e.g., '2026-09-01T00:00:00+09:00'). Trigger: Call this whenever the user query mentions any relative or absolute time constraint in any language (e.g., today, yesterday, last week, last month, recently, Aug 1, Aug 10 to Sep 1, since Monday, before Sep 15, in Q3). Model responsibility: You (the calling LLM) know current date and user local time, so you must convert natural language time expressions into absolute timestamps. Consequence: If omitted, the server falls back to heuristic guessing which may misinterpret timezone day boundaries or relative dates.
untilNoRFC 3339 timestamp with timezone offset (e.g., '2026-09-02T00:00:00+09:00'). When used with since, defines the half-open interval [since, until) with until > since (maximum 90 days span). Trigger: Pass when the user query specifies an end date or bounded window in any language (e.g., yesterday end of day, by Aug 10, Aug 10 to Sep 1). Model responsibility: Convert natural language end bounds into absolute timestamps with timezone offsets. Consequence: If omitted, the window is open-ended on the upper side or derived heuristically.
actionNoUsage action or audit-event action filter, depending on the tool.
bucketNoMemory bucket or namespace to read from or write to; use % only for tools that support wildcard reads.
offsetNoNumber of matching records to skip for pagination.
sourceNoOptional source filter for system statistics.events
target_idNoOptional audit target ID to filter audit events.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds useful behavioral context beyond that: source-specific capabilities, permission scoping ('admin' for consolidation), and the fact that this is a merged replacement for two legacy tools.

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?

Two dense sentences with no filler. The key disambiguation between source modes is front-loaded, and the legacy-tool consolidation note is valuable context rather than redundancy.

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?

The tool is complex with 9 optional parameters, two distinct modes, and an output schema, and the description does a good job of explaining the two source modes and their intended users. The since/until semantics fall to the schema, which is rich enough, so nothing critical is missing. Slightly more detail on what the returned audit records contain could push this to 5, but the output schema likely covers that.

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, but the description adds meaning to the 'source' parameter that the schema alone does not provide ('Optional source filter for system statistics' is vague by comparison). The description clarifies what values events and consolidation actually represent, which materially helps parameter selection.

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 states a specific verb ('query') and resource ('audit'), then precisely breaks out the two source modes ('source='events'' and 'source='consolidation''). It also names the legacy tools it consolidates, so an agent can distinguish this from other memory/query tools without opening the 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?

Usage guidance is explicit: normal users should prefer memory_activity for event queries, while consolidation audit records are flagged as admin-scoped. The description also clarifies scope by naming the legacy query_audit_events/query_consolidation_audit tools it replaces, giving clear routing context.

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.