canvas_get_conversation
Retrieve detailed information about a specific conversation using its unique ID to manage and track communications within the Canvas Learning Management System.
Instructions
Get details of a specific conversation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conversation_id | Yes | ID of the conversation |
Input Schema (JSON Schema)
{
"properties": {
"conversation_id": {
"description": "ID of the conversation",
"type": "number"
}
},
"required": [
"conversation_id"
],
"type": "object"
}
Implementation Reference
- src/index.ts:660-669 (registration)Registration of the 'canvas_get_conversation' MCP tool, including its name, description, and input schema requiring a conversation_id.name: "canvas_get_conversation", description: "Get details of a specific conversation", inputSchema: { type: "object", properties: { conversation_id: { type: "number", description: "ID of the conversation" } }, required: ["conversation_id"] } },
- src/client.ts:510-513 (handler)Handler function that executes the core logic of fetching the conversation details from the Canvas API using the provided conversation ID.async getConversation(conversationId: number): Promise<CanvasConversation> { const response = await this.client.get(`/conversations/${conversationId}`); return response.data; }
- src/types.ts:423-443 (schema)TypeScript interface defining the structure of a CanvasConversation object returned by the tool.export interface CanvasConversation { id: number; subject: string; workflow_state: 'read' | 'unread' | 'archived'; last_message: string; last_message_at: string; last_authored_message: string; last_authored_message_at: string; message_count: number; subscribed: boolean; private: boolean; starred: boolean; properties: string[]; audience: number[]; audience_contexts: { [key: string]: string[]; }; avatar_url: string; participants: CanvasConversationParticipant[]; messages?: CanvasConversationMessage[]; }
- src/index.ts:1071-1073 (registration)Registration of the tool list handler that exposes all MCP tools, including canvas_get_conversation, via ListToolsRequestSchema.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
- src/index.ts:1075-1083 (registration)Registration of the CallToolRequestSchema handler containing the switch case that dispatches to the canvas_get_conversation implementation.// Handle tool calls with comprehensive error handling this.server.setRequestHandler(CallToolRequestSchema, async (request) => { try { const args = request.params.arguments || {}; const toolName = request.params.name; console.error(`[Canvas MCP] Executing tool: ${toolName}`); switch (toolName) {