canvas_list_discussion_topics
Retrieve all discussion topics within a specific course using the Canvas MCP Server V2.0, enabling efficient management and review of course-related discussions.
Instructions
List all discussion topics in a course
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| course_id | Yes | ID of the course |
Input Schema (JSON Schema)
{
"properties": {
"course_id": {
"description": "ID of the course",
"type": "number"
}
},
"required": [
"course_id"
],
"type": "object"
}
Implementation Reference
- src/index.ts:521-529 (registration)Registers the canvas_list_discussion_topics tool including its name, description, and input schema that requires a course_id.name: "canvas_list_discussion_topics", description: "List all discussion topics in a course", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" } }, required: ["course_id"] }
- src/client.ts:656-663 (handler)Core handler function in CanvasClient that makes the API request to retrieve discussion topics for a given course, including related assignments.async listDiscussionTopics(courseId: number): Promise<CanvasDiscussionTopic[]> { const response = await this.client.get(`/courses/${courseId}/discussion_topics`, { params: { include: ['assignment'] } }); return response.data; }
- src/types.ts:220-234 (schema)TypeScript interface defining the structure of Canvas discussion topics returned by the tool.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; }
- src/index.ts:1010-1011 (handler)Handler for reading discussion topics as a resource (discussions://{course.id}), which calls the same underlying client method.content = await this.client.listDiscussionTopics(parseInt(id)); break;