Skip to main content
Glama

search_traces

Query OpenTelemetry traces with service, operation, time, duration, error, tag, and advanced filters to find relevant spans for debugging and analysis.

Instructions

Search for OpenTelemetry traces with filters.

Supports both simple parameters and advanced generic filter system.

Args: service_name: Filter by service name (use filters for advanced queries) operation_name: Filter by operation/span name start_time: Start time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z) end_time: End time in ISO 8601 format min_duration_ms: Minimum trace duration in milliseconds max_duration_ms: Maximum trace duration in milliseconds gen_ai_system: Filter by LLM provider (e.g., openai, anthropic) gen_ai_request_model: Filter by requested model name (e.g., gpt-4) gen_ai_response_model: Filter by actual model used (e.g., gpt-4-0613) has_error: Filter traces with errors tags: Additional tag filters as key-value pairs filters: Generic 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" limit: Maximum number of traces to return (1-1000, default: 100)

Returns: JSON string with search results

Filter Examples: Find expensive traces: {"field": "gen_ai.usage.total_tokens", "operator": "gt", "value": 5000, "value_type": "number"}

Filter by multiple models:
{"field": "gen_ai.request.model", "operator": "in", "values": ["gpt-4", "claude-3"], "value_type": "string"}

Check if attribute exists:
{"field": "gen_ai.request.temperature", "operator": "exists", "value_type": "number"}

Find streaming requests:
{"field": "gen_ai.request.is_streaming", "operator": "equals", "value": true, "value_type": "boolean"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNo
limitNo
filtersNo
end_timeNo
has_errorNo
start_timeNo
service_nameNo
gen_ai_systemNo
operation_nameNo
max_duration_msNo
min_duration_msNo
gen_ai_request_modelNo
gen_ai_response_modelNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It implies a read-only search and documents the limit default (100) and range (1-1000), but says nothing about ordering, pagination, or result shape beyond 'JSON string with search results'. Adequate but thin for a tool with zero annotation coverage.

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 with purpose, then a structured Args block and concrete examples. It is long, but given the 0% schema coverage the per-parameter documentation is earned rather than redundant.

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?

An output schema exists, so return-value detail is unnecessary, and the description covers all 13 params including the nested filter semantics. The remaining gap is the lack of sibling differentiation and pagination/ordering behavior.

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 description coverage is 0%, so the description must compensate, and it does: every one of the 13 parameters is documented in the Args block, and the complex 'filters' object is fully spelled out with field/operator/value/values/value_type and worked examples. Slightly marked down only because 'tags' is left vague.

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?

States a specific verb+resource (search OpenTelemetry traces) and adds a useful scope note about simple vs. generic filter modes. It does not, however, distinguish itself from near-siblings like search_spans_tool or find_errors, so an agent must infer the boundary.

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

Usage Guidelines3/5

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

Gives parameter-level guidance ('use filters for advanced queries') but no tool-level guidance about when to prefer this over find_errors, get_trace, or the LLM-specific trace helpers. Usage is implied by the filter list rather than stated.

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