Skip to main content
Glama

Get Traces

get_traces
Read-onlyIdempotent

Query stored traces with exact-match, score-range, time and full-text filters, plus pagination, sorting and optional dashboard summary. Returns ranked snippets and totals for agent observability.

Instructions

Query stored traces with filters, pagination and sorting; optionally with the dashboard summary.

What it does. Read-only, local. Exact-match agent_name and framework, inclusive since and until, min_score and max_score on each trace's latest evaluation, and q: full-text search, ranked, with a snippet. limit is 1..1000 (default 50). A crossed range is refused, never returned as an empty page. Full detail: iris://capabilities.

When not to use it. To score a trace (evaluate_output) or create one (log_trace). As a live stream: poll with backoff.

Returns. JSON: untrusted, traces, total, limit, offset, summary, search.

Errors. IRIS_STORAGE_ERROR. Out-of-range bounds are refused, naming the values; no match is total 0, not an error. Failures return {"error":{code,message,recovery}} with isError; follow recovery.

Siblings. log_trace — record an execution; evaluate_output — score one output; delete_trace — remove one trace.

Input Schema

NameRequiredDescriptionDefault
qNoFull-text search over input, output, tool-call values, metadata values and span attribute and event values. Every word must appear; "quoted phrase"; word* for a prefix of 3+ characters (1 for CJK). Case and accents ignored. At most 16 terms, 4 of them prefixes
limitNoResults per page (default 50, max 1000 — values above are rejected)
sinceNoInclusive lower bound, an ISO 8601 timestamp or date; anything else is rejected
untilNoISO 8601 timestamp (or date) upper bound — return traces with timestamp <= this; must not be earlier than `since`
offsetNoZero-based pagination offset — skip first N results (non-negative integer)
sessionNoFilter by session id — the turns of one conversation, as logged with session_id
sort_byNoSort by timestamp | latency_ms | cost_usd | relevance (default relevance with q, else timestamp)
frameworkNoFilter by agent framework — exact match (e.g., langchain, autogen)
max_scoreNoMaximum eval score filter (0..1; values outside are rejected) — applied to LATEST eval per trace
min_scoreNoMinimum score (0..1) of each trace's latest evaluation; at most max_score
agent_nameNoFilter by agent name — exact match (no wildcards)
sort_orderNoSort order: asc | desc (default desc — most recent / highest first)desc
include_textNoReturn each stored text whole. By default each is cut to 500 characters, and the trace's cut lists what was cut with its full length; iris://traces/{trace_id} reads one trace whole
include_summaryNoInclude dashboard summary stats in same response — saves a round-trip when ingesting for dashboards

Output Schema

NameRequiredDescriptionDefault
limitYes
totalYes
offsetYes
searchNo
tracesYes
summaryNo
untrustedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed28 schema fields changedv0.10.1
    • addedInput schema / properties / include_text
      Added value: +{
      +  "default": false,
      +  "description": "Return each stored text whole. By default each is cut to 500 characters, and the trace's cut lists what was cut with its full length; iris://traces/{trace_id} reads one trace whole",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / min_score / description
      Previous value: -"Minimum eval score filter (0..1; values outside are rejected) — applied to LATEST eval per trace, not all evals; must be <= max_score when both are set"New value: +"Minimum score (0..1) of each trace's latest evaluation; at most max_score"
    • addedInput schema / properties / q
      Added value: +{
      +  "description": "Full-text search over input, output, tool-call values, metadata values and span attribute and event values. Every word must appear; \"quoted phrase\"; word* for a prefix of 3+ characters (1 for CJK). Case and accents ignored. At most 16 terms, 4 of them prefixes",
      +  "maxLength": 500,
      +  "type": "string"
      +}
    • addedInput schema / properties / session
      Added value: +{
      +  "description": "Filter by session id — the turns of one conversation, as logged with session_id",
      +  "type": "string"
      +}
    • changedInput schema / properties / since / description
      Previous value: -"ISO 8601 timestamp (or date) lower bound — return traces with timestamp >= this; anything that is not an ISO timestamp is rejected, never treated as \"no bound\""New value: +"Inclusive lower bound, an ISO 8601 timestamp or date; anything else is rejected"
    • removedInput schema / properties / sort_by / default
      Removed value: -"timestamp"
    • changedInput schema / properties / sort_by / description
      Previous value: -"Sort by timestamp | latency_ms | cost_usd (default timestamp)"New value: +"Sort by timestamp | latency_ms | cost_usd | relevance (default relevance with q, else timestamp)"
    • changedInput schema / properties / sort_by / enum
      Previous value: -[
      -  "timestamp",
      -  "latency_ms",
      -  "cost_usd"
      -]New value: +[
      +  "timestamp",
      +  "latency_ms",
      +  "cost_usd",
      +  "relevance"
      +]
    • removedOutput schema / properties / limit / description
      Removed value: -"the page size applied"
    • removedOutput schema / properties / limit / maximum
      Removed value: -9007199254740991
    • removedOutput schema / properties / limit / minimum
      Removed value: --9007199254740991
    • changedOutput schema / properties / limit / type
      Previous value: -"integer"New value: +"number"
    • removedOutput schema / properties / offset / description
      Removed value: -"the offset applied"
    • removedOutput schema / properties / offset / maximum
      Removed value: -9007199254740991
    • removedOutput schema / properties / offset / minimum
      Removed value: --9007199254740991
    • changedOutput schema / properties / offset / type
      Previous value: -"integer"New value: +"number"
    • addedOutput schema / properties / search
      Added value: +{
      +  "additionalProperties": {},
      +  "properties": {},
      +  "type": "object"
      +}
    • removedOutput schema / properties / summary / description
      Removed value: -"the dashboard aggregates for the last hour, when include_summary was true"
    • removedOutput schema / properties / total / description
      Removed value: -"how many traces match the filters, across every page"
    • removedOutput schema / properties / total / maximum
      Removed value: -9007199254740991
    • removedOutput schema / properties / total / minimum
      Removed value: --9007199254740991
    • changedOutput schema / properties / total / type
      Previous value: -"integer"New value: +"number"
    • removedOutput schema / properties / traces / description
      Removed value: -"the page of traces: trace_id, agent_name, framework, input, output, tool_calls, latency_ms, token_usage, cost_usd, metadata, timestamp"
    • removedOutput schema / properties / traces / items / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / traces / items / properties
      Removed value: -{
      -  "trace_id": {
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / properties / traces / items / required
      Removed value: -[
      -  "trace_id"
      -]
    • removedOutput schema / properties / traces / items / type
      Removed value: -"object"
    • addedOutput schema / properties / untrusted
      Added value: +{
      +  "additionalProperties": {},
      +  "properties": {},
      +  "type": "object"
      +}
  2. Changed3 schema fields changedv0.9.0
    • changedInput schema / properties / agent_name / description
      Previous value: -"Filter by agent name — exact match (no wildcards in v0.4)"New value: +"Filter by agent name — exact match (no wildcards)"
    • changedInput schema / properties / limit / description
      Previous value: -"Results per page (default 50, max 1000 — values >1000 return 400)"New value: +"Results per page (default 50, max 1000 — values above are rejected)"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "limit": {
      +      "description": "the page size applied",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "offset": {
      +      "description": "the offset applied",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "summary": {
      +      "additionalProperties": {},
      +      "description": "the dashboard aggregates for the last hour, when include_summary was true",
      +      "properties": {},
      +      "type": "object"
      +    },
      +    "total": {
      +      "description": "how many traces match the filters, across every page",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "traces": {
      +      "description": "the page of traces: trace_id, agent_name, framework, input, output, tool_calls, latency_ms, token_usage, cost_usd, metadata, timestamp",
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "trace_id": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "trace_id"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "traces",
      +    "total",
      +    "limit",
      +    "offset"
      +  ],
      +  "type": "object"
      +}
  3. Changed16 schema fields changedv0.8.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / limit / maximum
      Added value: +1000
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedInput schema / properties / limit / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / max_score / description
      Previous value: -"Maximum eval score filter (0..1) — applied to LATEST eval per trace"New value: +"Maximum eval score filter (0..1; values outside are rejected) — applied to LATEST eval per trace"
    • addedInput schema / properties / max_score / maximum
      Added value: +1
    • addedInput schema / properties / max_score / minimum
      Added value: +0
    • changedInput schema / properties / min_score / description
      Previous value: -"Minimum eval score filter (0..1) — applied to LATEST eval per trace, not all evals"New value: +"Minimum eval score filter (0..1; values outside are rejected) — applied to LATEST eval per trace, not all evals; must be <= max_score when both are set"
    • addedInput schema / properties / min_score / maximum
      Added value: +1
    • addedInput schema / properties / min_score / minimum
      Added value: +0
    • changedInput schema / properties / offset / description
      Previous value: -"Zero-based pagination offset — skip first N results"New value: +"Zero-based pagination offset — skip first N results (non-negative integer)"
    • addedInput schema / properties / offset / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / offset / minimum
      Added value: +0
    • changedInput schema / properties / offset / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / since / description
      Previous value: -"ISO timestamp lower bound — return traces with timestamp >= this"New value: +"ISO 8601 timestamp (or date) lower bound — return traces with timestamp >= this; anything that is not an ISO timestamp is rejected, never treated as \"no bound\""
    • changedInput schema / properties / until / description
      Previous value: -"ISO timestamp upper bound — return traces with timestamp < this"New value: +"ISO 8601 timestamp (or date) upper bound — return traces with timestamp <= this; must not be earlier than `since`"
  4. Changed1 schema field changedv0.4.6
    • removedInput schema / additionalProperties
      Removed value: -false
  5. Changed11 schema fields changedv0.1.10
    • changedInput schema / properties / agent_name / description
      Previous value: -"Filter by agent name"New value: +"Filter by agent name — exact match (no wildcards in v0.4)"
    • changedInput schema / properties / framework / description
      Previous value: -"Filter by framework"New value: +"Filter by agent framework — exact match (e.g., langchain, autogen)"
    • changedInput schema / properties / include_summary / description
      Previous value: -"Include dashboard summary stats"New value: +"Include dashboard summary stats in same response — saves a round-trip when ingesting for dashboards"
    • changedInput schema / properties / limit / description
      Previous value: -"Results per page"New value: +"Results per page (default 50, max 1000 — values >1000 return 400)"
    • changedInput schema / properties / max_score / description
      Previous value: -"Maximum eval score filter"New value: +"Maximum eval score filter (0..1) — applied to LATEST eval per trace"
    • changedInput schema / properties / min_score / description
      Previous value: -"Minimum eval score filter"New value: +"Minimum eval score filter (0..1) — applied to LATEST eval per trace, not all evals"
    • changedInput schema / properties / offset / description
      Previous value: -"Pagination offset"New value: +"Zero-based pagination offset — skip first N results"
    • changedInput schema / properties / since / description
      Previous value: -"ISO timestamp lower bound"New value: +"ISO timestamp lower bound — return traces with timestamp >= this"
    • changedInput schema / properties / sort_by / description
      Previous value: -"Sort field"New value: +"Sort by timestamp | latency_ms | cost_usd (default timestamp)"
    • changedInput schema / properties / sort_order / description
      Previous value: -"Sort order"New value: +"Sort order: asc | desc (default desc — most recent / highest first)"
    • changedInput schema / properties / until / description
      Previous value: -"ISO timestamp upper bound"New value: +"ISO timestamp upper bound — return traces with timestamp < this"
  6. Addedv0.1.8
  7. Removedv0.1.7
  8. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive, and the description still adds substantial context the annotations cannot: results are untrusted JSON, crossed ranges are refused rather than returned as an empty page, out-of-range bounds are refused by naming values, no-match is total 0 rather than an error, and errors carry {code,message,recovery}. Default text truncation at 500 chars with a pointer to iris://traces/{trace_id} is disclosed up front.

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-loaded one-line purpose followed by labeled sections (What it does / When not to use / Returns / Errors / Siblings), which makes scanning fast. Slight redundancy: the 'Siblings' section largely re-states the alternatives already given in 'When not to use it'.

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?

For a 14-parameter query tool with an output schema, the description still covers the non-structural essentials: return envelope shape, error contract with recovery guidance, truncation behavior, and a pointer to iris://capabilities for full detail. Nothing an agent needs to invoke 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 schema already explains nearly every parameter in depth; the validation baseline is therefore 3. The description adds some meaning beyond it – ranked full-text search with a snippet, min/max_score scoped to each trace's latest evaluation, and include_summary framed as a round-trip saver – but most of its parameter statements restate the schema.

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?

Opens with a specific verb+resource+scope ('Query stored traces with filters, pagination and sorting; optionally with the dashboard summary') and the 'What it does' section enumerates exact filter semantics. It is unmistakably a filtered list/query tool and cannot be confused with log_trace or evaluate_output.

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?

Has an explicit 'When not to use it' section naming the alternatives (evaluate_output to score, log_trace to create) and a directive not to treat it as a live stream ('poll with backoff'). The 'Siblings' section reinforces routing to log_trace, evaluate_output and delete_trace.

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