Skip to main content
Glama

Get a comment by id

getComment

Retrieve a single comment using its unique ID.

Instructions

Fetch a single comment by id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commentIdYes

Implementation Reference

  • The getComment tool handler: registers a tool named 'getComment' that fetches a single comment by id from the Langfuse API endpoint /api/public/comments/{commentId}. The handler extracts commentId from args, URL-encodes it, and calls client.get().
    server.registerTool(
      "getComment",
      {
        title: "Get a comment by id",
        description: "Fetch a single comment by id.",
        inputSchema: { commentId: z.string().min(1) },
      },
      async ({ commentId }) => asJson(await client.get(`/api/public/comments/${enc(commentId)}`)),
    );
  • Input schema for the getComment tool: requires a single parameter 'commentId' which is a non-empty string (z.string().min(1)).
    {
      title: "Get a comment by id",
      description: "Fetch a single comment by id.",
      inputSchema: { commentId: z.string().min(1) },
    },
  • src/tools.ts:358-366 (registration)
    The getComment tool is registered via server.registerTool('getComment', ...) in the registerTools function. It's also listed in the TOOL_NAMES array at line 417.
    server.registerTool(
      "getComment",
      {
        title: "Get a comment by id",
        description: "Fetch a single comment by id.",
        inputSchema: { commentId: z.string().min(1) },
      },
      async ({ commentId }) => asJson(await client.get(`/api/public/comments/${enc(commentId)}`)),
    );
  • The 'enc' helper (encodeURIComponent) is used in the handler to safely encode commentId in the URL path.
    const enc = encodeURIComponent;
  • The 'asJson' helper transforms the API response into the MCP content format expected by the tool handler.
    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 are provided, so the description carries full burden. It only states 'Fetch a single comment by id' without disclosing any behavioral traits such as authorization requirements, error handling, or whether the comment is nested within other resources.

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?

The description is extremely concise with a single sentence of six words, conveying the essential information without any waste.

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?

Given no output schema, the description should indicate expected return value. It does not describe what fields are included, and the tool has many similar siblings, but no differentiation is provided. The lack of behavioral context makes it incomplete for an agent to know if this tool suffices.

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% (no description for commentId). The description adds no meaning beyond the schema; the schema already defines commentId as a required string with minLength 1. The description does not clarify how to obtain the ID or any format restrictions.

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 verb 'Fetch' and the resource 'a single comment by id', distinguishing it from sibling tools like listComments (which returns multiple) and other getters for different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have a specific comment ID and need the full comment. It does not explicitly mention when not to use it or alternative tools, but for a simple getter, this is clear enough.

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