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
| Name | Required | Description | Default |
|---|---|---|---|
| commentId | Yes | The unique identifier of the comment to retrieve |
Input Schema (JSON Schema)
{
"properties": {
"commentId": {
"description": "The unique identifier of the comment to retrieve",
"type": "string"
}
},
"required": [
"commentId"
],
"type": "object"
}
Implementation Reference
- src/tools/get-comment.ts:12-27 (handler)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, }; } }
- src/tools/get-comment.ts:4-8 (schema)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); }
- src/tools/get-comment.ts:10-10 (schema)TypeScript type definition inferred from the getCommentSchema for type safety.export type GetCommentArgs = z.infer<typeof getCommentSchema>;