Skip to main content
Glama

List observations

listObservations

Retrieve observations like spans, generations, and events using filters for page, name, type, level, time, and environment.

Instructions

List observations (spans, generations, events) with filters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default 1)
limitNoItems per page (default 50, max 100)
traceIdNo
nameNo
userIdNo
typeNo
levelNo
parentObservationIdNo
fromStartTimeNo
toStartTimeNo
environmentNo

Implementation Reference

  • src/tools.ts:44-64 (registration)
    Registration of the 'listObservations' tool via server.registerTool() with name 'listObservations'.
    // ---------- Observations ----------
    server.registerTool(
      "listObservations",
      {
        title: "List observations",
        description: "List observations (spans, generations, events) with filters.",
        inputSchema: {
          ...paginationShape,
          traceId: z.string().optional(),
          name: z.string().optional(),
          userId: z.string().optional(),
          type: z.enum(["SPAN", "GENERATION", "EVENT"]).optional(),
          level: z.enum(["DEBUG", "DEFAULT", "WARNING", "ERROR"]).optional(),
          parentObservationId: z.string().optional(),
          fromStartTime: z.string().datetime().optional(),
          toStartTime: z.string().datetime().optional(),
          environment: z.string().optional(),
        },
      },
      async (args) => asJson(await client.get("/api/public/observations", args)),
    );
  • Handler for 'listObservations': an async function that calls client.get('/api/public/observations', args) with the input arguments, wrapping the result in JSON text content via asJson().
    async (args) => asJson(await client.get("/api/public/observations", args)),
  • Input schema for 'listObservations' with filters: pagination (page, limit), traceId, name, userId, type (SPAN/GENERATION/EVENT), level (DEBUG/DEFAULT/WARNING/ERROR), parentObservationId, fromStartTime, toStartTime, and environment.
    inputSchema: {
      ...paginationShape,
      traceId: z.string().optional(),
      name: z.string().optional(),
      userId: z.string().optional(),
      type: z.enum(["SPAN", "GENERATION", "EVENT"]).optional(),
      level: z.enum(["DEBUG", "DEFAULT", "WARNING", "ERROR"]).optional(),
      parentObservationId: z.string().optional(),
      fromStartTime: z.string().datetime().optional(),
      toStartTime: z.string().datetime().optional(),
      environment: z.string().optional(),
    },
  • paginationShape is used via spread in the inputSchema to provide 'page' and 'limit' fields.
    export const paginationShape = {
      page: z.number().int().positive().optional().describe("Page number (default 1)"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Items per page (default 50, max 100)"),
    };
  • asJson helper used by the handler to wrap API response data into MCP content format.
    const asJson = (data: unknown) => ({
      content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
    });
Behavior2/5

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

No annotations provided. Description only says 'with filters' and does not disclose pagination, sorting, or response structure. Missing side-effect details.

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?

Single sentence, no waste, but overly brief for the complexity. Front-loads the main purpose but lacks structure.

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

Completeness1/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 guidance on default behavior or result format, the description is inadequate for effective tool use.

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 description coverage is 18% (only page/limit described). Description does not elaborate on the 9 other parameters, failing to compensate for low schema coverage.

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 the action (list) and resource (observations) with subtypes (spans, generations, events). However, it lacks differentiation from sibling list tools.

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?

No guidance on when to use this tool versus alternatives like getObservation or other list tools. Mentions filters but no context.

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