Skip to main content
Glama

Get Traces

get_traces
Read-onlyIdempotent

Query stored execution traces with filters for agent, framework, time, and score, plus pagination and sorting; optionally include dashboard summary in the same response.

Instructions

Query stored traces with filters, pagination and sorting; optionally include the dashboard summary in the same response.

What it does. Read-only, local storage only. Filters are exact-match (agent_name, framework), inclusive time bounds (since, until — an ISO 8601 timestamp or date) and a score range applied to the LATEST evaluation of each trace (min_score, max_score, 0..1). limit is 1..1000 (default 50), offset counts from 0, sort_by is timestamp, latency_ms or cost_usd, sort_order asc or desc (default: newest first). include_summary adds the one-hour dashboard aggregates. A crossed range (min above max, since after until) is refused naming both values rather than returning an empty page that reads as "no such traces".

When not to use it. To score a trace (evaluate_output). To create one (log_trace). As a live stream: this is a query, and Iris has no event stream — poll with backoff.

Returns. JSON with traces (the page of traces: trace_id, agent_name, framework, input, output, tool_calls, latency_ms, token_usage, cost_usd, metadata, timestamp); total (how many traces match the filters, across every page); limit (the page size applied); offset (the offset applied); summary (the dashboard aggregates for the last hour, when include_summary was true).

Errors. IRIS_STORAGE_ERROR when the database cannot be read. An out-of-range or crossed bound is refused before the handler runs, naming the values. An empty result is total 0, not an error. Every failure returns {"error":{"code","message","recovery":[]}} with isError true; follow recovery before retrying.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoResults per page (default 50, max 1000 — values above are rejected)
sinceNoISO 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"
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)
sort_byNoSort by timestamp | latency_ms | cost_usd (default timestamp)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 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
agent_nameNoFilter by agent name — exact match (no wildcards)
sort_orderNoSort order: asc | desc (default desc — most recent / highest first)desc
include_summaryNoInclude dashboard summary stats in same response — saves a round-trip when ingesting for dashboards

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitYesthe page size applied
totalYeshow many traces match the filters, across every page
offsetYesthe offset applied
tracesYesthe page of traces: trace_id, agent_name, framework, input, output, tool_calls, latency_ms, token_usage, cost_usd, metadata, timestamp
summaryNothe dashboard aggregates for the last hour, when include_summary was true

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 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"
      +}
  2. 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`"
  3. Changed1 schema field changedv0.4.6
    • removedInput schema / additionalProperties
      Removed value: -false
  4. 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"
  5. Addedv0.1.8
  6. Removedv0.1.7
  7. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and idempotentHint, and the description reinforces and extends this by stating read-only, local-storage-only behavior. It also discloses exact-match semantics, inclusive time bounds, LATEST-eval score filtering, crossed-range refusal, error shape, empty-result behavior, and the absence of an event stream — far beyond what annotations alone convey.

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?

The description is long but well structured with clear headings (What it does, When not to use it, Returns, Errors, Siblings) and a front-loaded summary sentence. Each section earns its place by covering important behavior, errors, and routing for an 11-parameter tool, so the length is appropriate to the complexity.

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?

Given the tool's complexity, 11 parameters, and rich annotations, the description is complete: it covers filters, pagination, sorting, optional summary, return shape, error codes, empty results, and sibling differentiation. An agent has everything needed to invoke it correctly and handle failures.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds material meaning beyond the schema: exact-match vs wildcard behavior, inclusive bounds, score applied to the LATEST evaluation, default sort order, and the crossed-range validation rule that names both offending values. This is genuinely helpful parameter semantics rather than schema repetition.

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 opening line states a specific verb and resource — 'Query stored traces with filters, pagination and sorting' — and the tool is immediately distinguished from siblings in the Siblings section. The description also names what it is not for (scoring, creating, live streaming), so an agent can tell it apart without inspecting other tools.

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?

There is an explicit 'When not to use it' section that names alternatives (evaluate_output, log_trace) and explains that this is a query, not a live stream, with polling guidance. This gives clear routing rules both for when to use the tool and when to choose a sibling.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/iris-eval/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server