Skip to main content
Glama
Arize-ai

@arizeai/phoenix-mcp

Official
by Arize-ai

get-spans

Retrieve spans from a Phoenix project with filters like time range, trace IDs, or status codes. Get trace operation details with pagination support.

Instructions

Get spans from a project with filtering criteria.

Spans represent individual operations or units of work within a trace. They contain timing information, attributes, and context about the operation being performed.

Example usage: Get recent spans from project "my-project" Get spans in a time range from project "my-project"

Expected return: Object containing spans array and optional next cursor for pagination. Example: { "spans": [ { "id": "span123", "name": "http_request", "context": { "trace_id": "trace456", "span_id": "span123" }, "start_time": "2024-01-01T12:00:00Z", "end_time": "2024-01-01T12:00:01Z", "attributes": { "http.method": "GET", "http.url": "/api/users" } } ], "nextCursor": "cursor_for_pagination" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
namesNo
cursorNo
end_timeNo
parent_idNo
trace_idsNo
span_kindsNo
start_timeNo
status_codesNo
project_identifierNo
include_annotationsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.39
  2. Removedv1.0.37
  3. Addedv1.0.15
  4. Removedv1.0.13
  5. Changed14 schema fields changedv1.0.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / endTime
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / end_time
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / include_annotations
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / names
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / parent_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • removedInput schema / properties / projectName
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / project_identifier
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / span_kinds
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / properties / startTime
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / start_time
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / status_codes
      Added value: +{
      +  "items": {
      +    "enum": [
      +      "OK",
      +      "ERROR",
      +      "UNSET"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / trace_ids
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "projectName"
      -]
  6. First observed

TDQS

B3/5.0
Behavior3/5

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

No annotations provided, so description carries full burden. Describes return format with pagination and sample spans. However, does not disclose whether it is read-only, auth requirements, rate limits, or error conditions. A read operation is implied but not stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Contains a clear structure including description, context, and example return. However, the example is verbose and repeats some information from the description. Could be more concise while retaining essential details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 11 parameters, no output schema, and no annotations, the description is insufficient. Provides a return example but does not cover most parameters or explain behavior like pagination limits or filtering logic.

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

Parameters2/5

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

Schema coverage is 0%, yet description only hints at filtering by time range and project. Does not explain any of the 11 parameters (e.g., names, cursor, status_codes). Adds little beyond context for example usage.

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?

Clearly states this tool retrieves spans with filtering criteria and explains what spans are. Distinguishes from sibling tools like list-traces by focusing on spans rather than traces, but does not explicitly contrast with similar tools.

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?

Provides example usages (time range, recent spans) but lacks guidance on when to use this tool versus alternatives like get-trace or list-traces. No exclusions or prerequisites mentioned.

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