Skip to main content
Glama

Get trace with full observation tree

getTrace

Fetch a trace by ID, including all nested observations.

Instructions

Fetch a single trace by id including all nested observations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
traceIdYes

Implementation Reference

  • src/tools.ts:34-42 (registration)
    Registration of the 'getTrace' tool on the MCP server using server.registerTool(...). It defines the tool name, title, description, input schema (traceId: string), and handler.
    server.registerTool(
      "getTrace",
      {
        title: "Get trace with full observation tree",
        description: "Fetch a single trace by id including all nested observations.",
        inputSchema: { traceId: z.string().min(1) },
      },
      async ({ traceId }) => asJson(await client.get(`/api/public/traces/${enc(traceId)}`)),
    );
  • The handler function for getTrace. It takes { traceId }, URL-encodes it, and calls client.get(`/api/public/traces/${enc(traceId)}`) to fetch a single trace including all nested observations.
    async ({ traceId }) => asJson(await client.get(`/api/public/traces/${enc(traceId)}`)),
  • Input schema for getTrace: requires a single 'traceId' field as a non-empty string (z.string().min(1)).
    inputSchema: { traceId: z.string().min(1) },
  • src/tools.ts:394-394 (registration)
    Exported TOOL_NAMES list includes 'getTrace' as one of the registered tool names.
    "getTrace",
  • The 'asJson' helper function used by the getTrace handler to format the API response as MCP content (JSON text).
    const asJson = (data: unknown) => ({
      content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
    });
    
    const enc = encodeURIComponent;
Behavior2/5

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

No annotations provided, so description carries the full burden. It mentions including all nested observations, but does not disclose error handling, rate limits, or what happens with invalid IDs. Lacks depth.

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?

One sentence, front-loaded with the verb, no wasted words. Could be slightly more informative without losing conciseness, but still efficient.

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?

For a simple get tool with one param and no output schema, the description should cover return structure, error cases, and parameter details. It only mentions 'all nested observations' but omits response format and error behavior.

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

Parameters1/5

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

Schema has 0% description coverage for the single parameter traceId. The description does not explain the parameter format, source, or constraints beyond the schema's minLength. Completely insufficient.

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 description clearly states the tool fetches a single trace by ID including nested observations, which is a specific verb-resource pair. It distinguishes from siblings like listTraces or getObservation.

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?

No explicit guidelines on when to use this tool vs alternatives. Usage is implied by the name and description, but no when-not-to or prerequisite information is provided.

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

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/hugoles/langfuse-mcp'

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