Skip to main content
Glama

summarize_conversation

Generate concise summaries of conversations using the specified conversation ID and prompt ID for better clarity and insight. Simplify lengthy discussions into key points.

Instructions

Summarize a conversation.

Input Schema

NameRequiredDescriptionDefault
conversation_idYes
end_dateNo
languageNo
limitNo
message_idsNo
prompt_idYes
start_dateNo

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "conversation_id": { "minLength": 1, "type": "string" }, "end_date": { "format": "date-time", "type": "string" }, "language": { "type": "string" }, "limit": { "default": 50, "type": "number" }, "message_ids": { "items": { "type": "string" }, "type": "array" }, "prompt_id": { "minLength": 1, "type": "string" }, "start_date": { "format": "date-time", "type": "string" } }, "required": [ "conversation_id", "prompt_id" ], "type": "object" }

Implementation Reference

  • The async handler function that implements the 'summarize_conversation' tool. It fetches messages if not provided, then calls the AI response API to generate the summary.
    async ( args: SummarizeConversationParams, { authInfo }, ): Promise<McpToolResponse> => { try { let message_ids: string[] = args.message_ids || []; // If no message ids are provided, get couple of messages from the conversation if (!args.message_ids) { const messages = await simplifiedApi.listMessages( args, setCarbonVoiceAuthHeader(authInfo?.token), ); message_ids = messages.results?.map((message) => message.id) || []; } const aiResponse = await simplifiedApi.aIResponseControllerCreateResponse( { prompt_id: args.prompt_id, message_ids: message_ids, channel_id: args.conversation_id, language: args.language, }, setCarbonVoiceAuthHeader(authInfo?.token), ); return formatToMCPToolResponse(aiResponse); } catch (error) { logger.error('Error summarizing conversation:', { error }); return formatToMCPToolResponse(error); } },
  • src/server.ts:487-529 (registration)
    Registers the 'summarize_conversation' tool on the MCP server with description, input schema reference, annotations, and inline handler.
    server.registerTool( 'summarize_conversation', { description: 'Summarize a conversation.', inputSchema: summarizeConversationParams.shape, annotations: { readOnlyHint: false, destructiveHint: false, }, }, async ( args: SummarizeConversationParams, { authInfo }, ): Promise<McpToolResponse> => { try { let message_ids: string[] = args.message_ids || []; // If no message ids are provided, get couple of messages from the conversation if (!args.message_ids) { const messages = await simplifiedApi.listMessages( args, setCarbonVoiceAuthHeader(authInfo?.token), ); message_ids = messages.results?.map((message) => message.id) || []; } const aiResponse = await simplifiedApi.aIResponseControllerCreateResponse( { prompt_id: args.prompt_id, message_ids: message_ids, channel_id: args.conversation_id, language: args.language, }, setCarbonVoiceAuthHeader(authInfo?.token), ); return formatToMCPToolResponse(aiResponse); } catch (error) { logger.error('Error summarizing conversation:', { error }); return formatToMCPToolResponse(error); } }, );
  • Zod schema defining the input parameters for the 'summarize_conversation' tool, including conversation_id, prompt_id, optional message_ids, language, date filters, and limit.
    export const summarizeConversationParams = z.object({ conversation_id: z.string().nonempty(), prompt_id: z.string().nonempty(), message_ids: z.array(z.string()).optional(), language: z.string().optional(), start_date: z.string().datetime().optional(), end_date: z.string().datetime().optional(), limit: z.number().optional().default(50), });
  • TypeScript type for SummarizeConversationParams inferred from the Zod schema.
    export type SummarizeConversationParams = z.infer< typeof summarizeConversationParams >;

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/PhononX/cv-mcp-server'

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