Skip to main content
Glama
AgentOps-AI

AgentOps MCP

Official
by AgentOps-AI

get_complete_trace

Retrieve full trace data and metrics using a trace ID to debug AI agent runs by analyzing complete execution details.

Instructions

Reserved for explicit requests for COMPLETE or ALL data. Get complete trace information and metrics by trace_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trace_idYesTrace ID

Implementation Reference

  • The handler for the 'get_complete_trace' tool. It fetches the trace information and metrics, then recursively fetches complete span information and metrics for all child spans, and returns the full trace as JSON.
    case "get_complete_trace": {
      const { trace_id } = args as { trace_id: string };
      const [traceInfo, traceMetrics] = await Promise.all([
        makeAuthenticatedRequest(`/public/v1/traces/${trace_id}`),
        makeAuthenticatedRequest(`/public/v1/traces/${trace_id}/metrics`),
      ]);
      const parentTrace = { ...traceInfo, metrics: traceMetrics };
    
      if (parentTrace.spans && Array.isArray(parentTrace.spans)) {
        for (let i = 0; i < parentTrace.spans.length; i++) {
          if (parentTrace.spans[i].span_id) {
            const span_id = parentTrace.spans[i].span_id;
            const [childSpanInfo, childSpanMetrics] = await Promise.all([
              makeAuthenticatedRequest(`/public/v1/spans/${span_id}`),
              makeAuthenticatedRequest(`/public/v1/spans/${span_id}/metrics`),
            ]);
            parentTrace.spans[i] = {
              ...childSpanInfo,
              metrics: childSpanMetrics,
            };
          }
        }
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(parentTrace, null, 2),
          },
        ],
      };
    }
  • src/index.ts:209-223 (registration)
    Registers the 'get_complete_trace' tool in the list of available tools, including its name, description, and input schema.
    {
      name: "get_complete_trace",
      description:
        "Reserved for explicit requests for COMPLETE or ALL data. Get complete trace information and metrics by trace_id.",
      inputSchema: {
        type: "object",
        properties: {
          trace_id: {
            type: "string",
            description: "Trace ID",
          },
        },
        required: ["trace_id"],
      },
    },
  • Defines the input schema for the 'get_complete_trace' tool, requiring a 'trace_id' string.
    inputSchema: {
      type: "object",
      properties: {
        trace_id: {
          type: "string",
          description: "Trace ID",
        },
      },
      required: ["trace_id"],
    },
Install Server

Other Tools

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/AgentOps-AI/agentops-mcp'

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