Skip to main content
Glama

canvas_get_discussion_topic

Retrieve detailed information about a specific discussion topic in a Canvas course by providing the course ID and topic ID.

Instructions

Get details of a specific discussion topic

Input Schema

NameRequiredDescriptionDefault
course_idYesID of the course
topic_idYesID of the discussion topic

Input Schema (JSON Schema)

{ "properties": { "course_id": { "description": "ID of the course", "type": "number" }, "topic_id": { "description": "ID of the discussion topic", "type": "number" } }, "required": [ "course_id", "topic_id" ], "type": "object" }

Implementation Reference

  • Core implementation of fetching a Canvas discussion topic via API call, including assignment details.
    async getDiscussionTopic(courseId: number, topicId: number): Promise<CanvasDiscussionTopic> { const response = await this.client.get(`/courses/${courseId}/discussion_topics/${topicId}`, { params: { include: ['assignment'] } }); return response.data; }
  • src/index.ts:532-541 (registration)
    MCP tool registration defining the tool name, description, and input schema validation.
    name: "canvas_get_discussion_topic", description: "Get details of a specific discussion topic", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" }, topic_id: { type: "number", description: "ID of the discussion topic" } }, required: ["course_id", "topic_id"] }
  • TypeScript interface defining the structure of a Canvas discussion topic response (output schema).
    export interface CanvasDiscussionTopic { id: number; title: string; message: string; html_url: string; posted_at: string; assignment_id: number | null; assignment?: CanvasAssignment; discussion_type: string; require_initial_post: boolean; user_has_posted: boolean; discussion_subentry_count: number; read_state: 'read' | 'unread'; unread_count: number; }
  • MCP server tool handler that validates input, calls the client method, and formats the response.
    try { const args = request.params.arguments || {}; const toolName = request.params.name; console.error(`[Canvas MCP] Executing tool: ${toolName}`); switch (toolName) {

Other Tools

Related Tools

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/DMontgomery40/mcp-canvas-lms'

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