Skip to main content
Glama

canvas_list_modules

Retrieve all course modules within Canvas LMS by providing the course ID. Simplify course management and module tracking with this API integration tool.

Instructions

List all modules in a course

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYesID of the course

Implementation Reference

  • src/index.ts:458-467 (registration)
    Registration of the 'canvas_list_modules' tool in the TOOLS array, including name, description, and input schema definition.
      name: "canvas_list_modules",
      description: "List all modules in a course",
      inputSchema: {
        type: "object",
        properties: {
          course_id: { type: "number", description: "ID of the course" }
        },
        required: ["course_id"]
      }
    },
  • Core handler function that executes the Canvas API call to list modules for a given course ID. Called by the MCP tool handler.
    async listModules(courseId: number): Promise<CanvasModule[]> {
      const response = await this.client.get(`/courses/${courseId}/modules`, {
        params: {
          include: ['items']
        }
      });
      return response.data;
    }
  • Input schema validation for the canvas_list_modules tool, requiring course_id.
      inputSchema: {
        type: "object",
        properties: {
          course_id: { type: "number", description: "ID of the course" }
        },
        required: ["course_id"]
      }
    },
  • Type definition for CanvasModule, used in the return type of listModules.
    export interface CanvasModule {
      id: number;
      name: string;
      position: number;
      unlock_at: string | null;
      require_sequential_progress: boolean;
      prerequisite_module_ids: number[];
      state: CanvasModuleState;
      completed_at: string | null;
      items_count: number;
      items_url: string;
      items?: CanvasModuleItem[];
    }
    
    export type CanvasModuleState = 'locked' | 'unlocked' | 'started' | 'completed';
Install Server

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