Skip to main content
Glama

canvas_list_pages

Retrieve a list of pages within a Canvas course using the course ID to organize and manage course content efficiently through the Canvas LMS API.

Instructions

List pages in a course

Input Schema

NameRequiredDescriptionDefault
course_idYesID 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:319-328 (registration)
    Registration of the canvas_list_pages tool including its name, description, and input schema requiring course_id.
    { name: "canvas_list_pages", description: "List pages in a course", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" } }, required: ["course_id"] }
  • Handler for canvas_list_pages tool: extracts course_id, calls client.listPages, returns JSON stringified pages.
    case "canvas_list_pages": { const { course_id } = args as { course_id: number }; if (!course_id) throw new Error("Missing required field: course_id"); const pages = await this.client.listPages(course_id); return { content: [{ type: "text", text: JSON.stringify(pages, null, 2) }] }; }
  • CanvasClient.listPages implementation: makes GET request to /courses/{courseId}/pages and returns the pages data.
    async listPages(courseId: number): Promise<CanvasPage[]> { const response = await this.client.get(`/courses/${courseId}/pages`); return response.data; }
  • TypeScript interface definition for CanvasPage, the return type of listPages.
    export interface CanvasPage { page_id: number; url: string; title: string; body: string; created_at: string; updated_at: string; published: boolean; front_page: boolean; locked_for_user: boolean; lock_explanation?: string; editing_roles: string; html_url: string; }

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