Skip to main content
Glama

List comments

listComments

List comments attached to traces, observations, sessions, or prompts. Filter by object type, object ID, or author user ID, and paginate results.

Instructions

List comments attached to traces, observations, sessions, or prompts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default 1)
limitNoItems per page (default 50, max 100)
objectTypeNoFilter by attached object type
objectIdNo
authorUserIdNo

Implementation Reference

  • The handler function that executes the 'listComments' tool logic. It registers the tool with name 'listComments', defines the input schema (with optional objectType, objectId, authorUserId filters plus pagination), and the handler calls GET /api/public/comments with the provided args.
    server.registerTool(
      "listComments",
      {
        title: "List comments",
        description: "List comments attached to traces, observations, sessions, or prompts.",
        inputSchema: {
          ...paginationShape,
          objectType: z
            .enum(["TRACE", "OBSERVATION", "SESSION", "PROMPT"])
            .optional()
            .describe("Filter by attached object type"),
          objectId: z.string().optional(),
          authorUserId: z.string().optional(),
        },
      },
      async (args) => asJson(await client.get("/api/public/comments", args)),
    );
  • The input schema for the 'listComments' tool, defined inline in the registerTool call. It uses spread paginationShape from schemas.ts and optional Zod fields: objectType (enum TRACE/OBSERVATION/SESSION/PROMPT), objectId (string), and authorUserId (string).
    server.registerTool(
      "listComments",
      {
        title: "List comments",
        description: "List comments attached to traces, observations, sessions, or prompts.",
        inputSchema: {
          ...paginationShape,
          objectType: z
            .enum(["TRACE", "OBSERVATION", "SESSION", "PROMPT"])
            .optional()
            .describe("Filter by attached object type"),
          objectId: z.string().optional(),
          authorUserId: z.string().optional(),
        },
      },
      async (args) => asJson(await client.get("/api/public/comments", args)),
    );
  • src/tools.ts:392-420 (registration)
    The TOOL_NAMES array that exports the name 'listComments' as one of the registered tool names, used for external reference/type safety.
    export const TOOL_NAMES = [
      "listTraces",
      "getTrace",
      "listObservations",
      "getObservation",
      "listSessions",
      "getSession",
      "listScores",
      "getScore",
      "listScoreConfigs",
      "getScoreConfig",
      "listPrompts",
      "getPrompt",
      "listDatasets",
      "getDataset",
      "listDatasetItems",
      "getDatasetItem",
      "listDatasetRuns",
      "getDatasetRun",
      "getMetrics",
      "getDailyMetrics",
      "listModels",
      "getModel",
      "listProjects",
      "listComments",
      "getComment",
      "getMedia",
      "getHealth",
    ] as const;
  • The paginationShape helper schema used by the 'listComments' tool, providing optional page (positive int) and limit (1-100 int) fields with descriptions.
    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)"),
    };
Behavior2/5

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

No annotations provided, so description must bear full burden. It only states the purpose; no disclosure of pagination, sorting, authentication, or side effects.

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

Conciseness5/5

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

Single sentence, 10 words, front-loaded with verb and resource. No wasted words.

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?

For a tool with 5 parameters and no annotations or output schema, the description is far from complete. It omits pagination details, filtering behavior, and response format.

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 60%, but the description adds no parameter information. It does not compensate for the undocumented parameters (objectId, authorUserId) beyond what the schema provides.

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 action ('List'), the resource ('comments'), and the scope ('attached to traces, observations, sessions, or prompts'). It distinguishes from sibling tools like getComment and other 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 vs alternatives, no mention of filtering or context. The description is purely functional without usage advice.

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