Skip to main content
Glama

Search Traces

search_traces
Read-onlyIdempotent

Filter and retrieve OpenTelemetry traces by service, operation, time, duration, errors, and LLM models. Use simple parameters or advanced generic filters to locate specific traces.

Instructions

Search for OpenTelemetry traces with filters.

Supports both simple parameters and advanced generic filter system.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNoAdditional tag filters as key-value pairs
limitNoMaximum number of traces to return (1-1000, default: 100)
filtersNoGeneric filter conditions (advanced) - list of filter objects with: - field: Field name in dotted notation (e.g., "gen_ai.usage.prompt_tokens") - operator: Comparison operator (equals, not_equals, gt, lt, gte, lte, contains, not_contains, starts_with, ends_with, in, not_in, between, exists, not_exists) - value: Single value for most operators - values: List of values for "in", "not_in", "between" operators - value_type: Type of value(s) - "string", "number", or "boolean"
end_timeNoEnd time in ISO 8601 format
has_errorNoFilter traces with errors
start_timeNoStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)
service_nameNoFilter by service name (use filters for advanced queries)
gen_ai_systemNoFilter by LLM provider (e.g., openai, anthropic)
operation_nameNoFilter by operation/span name
max_duration_msNoMaximum trace duration in milliseconds
min_duration_msNoMinimum trace duration in milliseconds
gen_ai_request_modelNoFilter by requested model name (e.g., gpt-4)
gen_ai_response_modelNoFilter by actual model used (e.g., gpt-4-0613)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYes
tracesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changedv0.11.0
    • addedInput schema / properties / end_time / description
      Added value: +"End time in ISO 8601 format"
    • addedInput schema / properties / filters / description
      Added value: +"Generic filter conditions (advanced) - list of filter objects with:\n- field: Field name in dotted notation (e.g., \"gen_ai.usage.prompt_tokens\")\n- operator: Comparison operator (equals, not_equals, gt, lt, gte, lte, contains,\n           not_contains, starts_with, ends_with, in, not_in, between, exists, not_exists)\n- value: Single value for most operators\n- values: List of values for \"in\", \"not_in\", \"between\" operators\n- value_type: Type of value(s) - \"string\", \"number\", or \"boolean\""
    • addedInput schema / properties / gen_ai_request_model / description
      Added value: +"Filter by requested model name (e.g., gpt-4)"
    • addedInput schema / properties / gen_ai_response_model / description
      Added value: +"Filter by actual model used (e.g., gpt-4-0613)"
    • addedInput schema / properties / gen_ai_system / description
      Added value: +"Filter by LLM provider (e.g., openai, anthropic)"
    • addedInput schema / properties / has_error / description
      Added value: +"Filter traces with errors"
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of traces to return (1-1000, default: 100)"
    • addedInput schema / properties / max_duration_ms / description
      Added value: +"Maximum trace duration in milliseconds"
    • addedInput schema / properties / min_duration_ms / description
      Added value: +"Minimum trace duration in milliseconds"
    • addedInput schema / properties / operation_name / description
      Added value: +"Filter by operation/span name"
    • addedInput schema / properties / service_name / description
      Added value: +"Filter by service name (use filters for advanced queries)"
    • addedInput schema / properties / start_time / description
      Added value: +"Start time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)"
    • addedInput schema / properties / tags / description
      Added value: +"Additional tag filters as key-value pairs"
  2. Changed6 schema fields changedv0.5.0
    • addedOutput schema / description
      Added value: +"Structured response shape for the search_traces tool.\n\nA real return type (rather than a bare str) lets FastMCP auto-derive a\ngenuinely useful MCP outputSchema/structuredContent instead of the\ndegenerate {\"result\": \"<json string>\"} wrap every str-returning tool\nproduces today - see tools/search.py."
    • addedOutput schema / properties / count
      Added value: +{
      +  "type": "integer"
      +}
    • removedOutput schema / properties / result
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / traces
      Added value: +{
      +  "items": {
      +    "description": "Simplified trace summary for list results.",
      +    "properties": {
      +      "duration_ms": {
      +        "type": "number"
      +      },
      +      "has_errors": {
      +        "default": false,
      +        "type": "boolean"
      +      },
      +      "llm_span_count": {
      +        "default": 0,
      +        "type": "integer"
      +      },
      +      "operation_name": {
      +        "type": "string"
      +      },
      +      "service_name": {
      +        "type": "string"
      +      },
      +      "span_count": {
      +        "type": "integer"
      +      },
      +      "start_time": {
      +        "format": "date-time",
      +        "type": "string"
      +      },
      +      "status": {
      +        "enum": [
      +          "OK",
      +          "ERROR",
      +          "UNSET"
      +        ],
      +        "type": "string"
      +      },
      +      "total_tokens": {
      +        "default": 0,
      +        "type": "integer"
      +      },
      +      "trace_id": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "trace_id",
      +      "service_name",
      +      "operation_name",
      +      "start_time",
      +      "duration_ms",
      +      "status",
      +      "span_count"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "count",
      +  "traces"
      +]
    • removedOutput schema / x-fastmcp-wrap-result
      Removed value: -true
  3. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds the filter-system feature but does not disclose any additional behavioral traits such as default time ranges, pagination behavior, or result ordering; this is acceptable but not a strong contribution.

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?

The description is short and front-loaded with the core purpose. The second sentence about simple versus advanced filters is useful, though it is somewhat generic and could have been replaced with more specific guidance.

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?

Given the rich input schema, full schema coverage, output schema, and comprehensive annotations, the description is adequate for invoking the tool. It could be more complete by clarifying the default search window or how results are returned, but those gaps are partially filled by the schema and output schema.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 13 parameters in detail. The description's mention of 'simple parameters and advanced generic filter system' adds a useful high-level categorization, but it does not add meaning beyond what the schema already provides.

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?

The description clearly states the tool searches OpenTelemetry traces and supports filtering. It is specific about the resource and action, though it does not explicitly differentiate itself from search_spans_tool or call out that get_trace is for single-trace retrieval.

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

Usage Guidelines2/5

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

The description mentions that both simple parameters and an advanced generic filter system are supported, which hints at how to choose between those approaches. However, it gives no guidance on when to use this tool versus sibling tools like search_spans_tool, get_trace, or find_errors.

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