Skip to main content
Glama
therealsachin

Langfuse MCP Server

get_comment

Retrieve detailed information about a specific comment using its unique identifier to analyze feedback or trace data in Langfuse analytics.

Instructions

Get detailed information about a specific comment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commentIdYesThe unique identifier of the comment to retrieve

Implementation Reference

  • The main handler function that executes the 'get_comment' tool logic: calls the Langfuse client to retrieve the comment by ID, formats the response as MCP content, and handles errors.
    export async function getComment(
      client: LangfuseAnalyticsClient,
      args: GetCommentArgs
    ) {
      try {
        const data = await client.getComment(args.commentId);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      } catch (error: any) {
        return {
          content: [{ type: 'text' as const, text: `Error getting comment: ${error.message}` }],
          isError: true,
        };
      }
    }
  • Zod schema for validating the input arguments to the 'get_comment' tool, requiring a commentId string.
    export const getCommentSchema = z.object({
      commentId: z.string({
        description: 'The unique identifier of the comment to retrieve'
      }),
    });
  • src/index.ts:836-849 (registration)
    Tool registration in the listTools handler: defines the 'get_comment' tool's metadata, description, and input schema for MCP discovery.
    {
      name: 'get_comment',
      description: 'Get detailed information about a specific comment.',
      inputSchema: {
        type: 'object',
        properties: {
          commentId: {
            type: 'string',
            description: 'The unique identifier of the comment to retrieve',
          },
        },
        required: ['commentId'],
      },
    },
  • src/index.ts:1141-1144 (registration)
    Dispatch/registration in the callTool switch statement: parses arguments using the schema and invokes the getComment handler.
    case 'get_comment': {
      const args = getCommentSchema.parse(request.params.arguments);
      return await getComment(this.client, args);
    }
  • TypeScript type definition inferred from the getCommentSchema for type safety.
    export type GetCommentArgs = z.infer<typeof getCommentSchema>;

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

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