canvas_get_course
Retrieve detailed course information from the Canvas Learning Management System by providing the course ID. Facilitates access to essential data for managing and organizing educational resources.
Instructions
Get detailed information about a specific 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:1101-1109 (handler)Handler that executes the canvas_get_course tool: validates course_id input, calls CanvasClient.getCourse(course_id), and returns the course data as JSON text.case "canvas_get_course": { const { course_id } = args as { course_id: number }; if (!course_id) throw new Error("Missing required field: course_id"); const course = await this.client.getCourse(course_id); return { content: [{ type: "text", text: JSON.stringify(course, null, 2) }] }; }
- src/index.ts:62-72 (schema)Tool schema definition for canvas_get_course, specifying input as object with required number course_id.{ name: "canvas_get_course", description: "Get detailed information about a specific course", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" } }, required: ["course_id"] } },
- src/index.ts:1071-1073 (registration)Registers the list tools handler which returns the TOOLS array containing canvas_get_course.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
- src/client.ts:225-232 (helper)CanvasClient.getCourse implementation that fetches detailed course information from Canvas API with specified includes.async getCourse(courseId: number): Promise<CanvasCourse> { const response = await this.client.get(`/courses/${courseId}`, { params: { include: ['total_students', 'teachers', 'term', 'course_progress', 'sections', 'syllabus_body'] } }); return response.data; }