Skip to main content
Glama
create-comment.tsβ€’1.09 kB
import { z } from 'zod'; import { LangfuseAnalyticsClient } from '../langfuse-client.js'; export const createCommentSchema = z.object({ objectType: z.enum(['trace', 'observation', 'session', 'prompt'], { description: 'The type of object to comment on' }), objectId: z.string({ description: 'The unique identifier of the object to comment on' }), content: z.string({ description: 'The content/text of the comment' }), authorUserId: z.string({ description: 'The user ID of the comment author (optional, may be inferred from authentication)' }).optional(), }); export type CreateCommentArgs = z.infer<typeof createCommentSchema>; export async function createComment( client: LangfuseAnalyticsClient, args: CreateCommentArgs ) { try { const data = await client.createComment(args); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; } catch (error: any) { return { content: [{ type: 'text' as const, text: `Error creating comment: ${error.message}` }], isError: true, }; } }

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