Skip to main content
Glama
list-comments.tsβ€’1.14 kB
import { z } from 'zod'; import { LangfuseAnalyticsClient } from '../langfuse-client.js'; export const listCommentsSchema = z.object({ page: z.number().int().positive().optional().describe('Page number for pagination (starts at 1)'), limit: z.number().int().min(1).max(100).optional().describe('Maximum number of comments to return (max 100)'), objectType: z.enum(['trace', 'observation', 'session', 'prompt']).optional().describe('Filter comments by object type'), objectId: z.string().optional().describe('Filter comments by specific object ID'), authorUserId: z.string().optional().describe('Filter comments by author user ID'), }); export type ListCommentsArgs = z.infer<typeof listCommentsSchema>; export async function listComments( client: LangfuseAnalyticsClient, args: ListCommentsArgs ) { try { const data = await client.listComments(args); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; } catch (error: any) { return { content: [{ type: 'text' as const, text: `Error listing comments: ${error.message}` }], isError: true, }; } }

Implementation Reference

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