canvas_get_page
Retrieve the content of a specific page from a Canvas course using the course ID and page URL slug. Simplify access to Canvas LMS course materials.
Instructions
Get content of a specific page
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| course_id | Yes | ID of the course | |
| page_url | Yes | URL slug of the page |
Input Schema (JSON Schema)
{
"properties": {
"course_id": {
"description": "ID of the course",
"type": "number"
},
"page_url": {
"description": "URL slug of the page",
"type": "string"
}
},
"required": [
"course_id",
"page_url"
],
"type": "object"
}
Implementation Reference
- src/index.ts:1280-1290 (handler)MCP tool handler implementation for 'canvas_get_page'. Parses arguments, validates inputs, calls CanvasClient.getPage(), and returns JSON response.case "canvas_get_page": { const { course_id, page_url } = args as { course_id: number; page_url: string }; if (!course_id || !page_url) { throw new Error("Missing required fields: course_id and page_url"); } const page = await this.client.getPage(course_id, page_url); return { content: [{ type: "text", text: JSON.stringify(page, null, 2) }] }; }
- src/index.ts:331-341 (schema)Input schema definition for the canvas_get_page tool, specifying course_id (number) and page_url (string) as required parameters.name: "canvas_get_page", description: "Get content of a specific page", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" }, page_url: { type: "string", description: "URL slug of the page" } }, required: ["course_id", "page_url"] } },
- src/index.ts:1072-1074 (registration)Registration of tool list handler. Returns the TOOLS array which includes the canvas_get_page tool definition.tools: TOOLS }));
- src/client.ts:433-436 (helper)CanvasClient.getPage method: Makes API call to retrieve specific page content from Canvas and returns CanvasPage object.async getPage(courseId: number, pageUrl: string): Promise<CanvasPage> { const response = await this.client.get(`/courses/${courseId}/pages/${pageUrl}`); return response.data; }