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';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool lists modules but fails to describe key behaviors such as pagination, rate limits, authentication requirements, error handling, or the format of returned data. This is a significant gap for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core functionality ('List all modules in a course') with zero wasted words. It is appropriately sized for a simple tool and avoids unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not address behavioral aspects like pagination or error handling, nor does it explain the return format. For a tool that likely returns a list of modules, more context is needed to help the agent understand what to expect from the operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'course_id' parameter clearly documented in the schema. The description does not add any meaning beyond this, such as explaining where to find the course ID or its format. Given the high schema coverage, a baseline score of 3 is appropriate, as the schema adequately handles parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List all modules in a course' clearly states the verb ('List') and resource ('modules in a course'), making the tool's purpose immediately understandable. However, it does not explicitly differentiate from sibling tools like 'canvas_get_module' (which retrieves a single module) or 'canvas_list_module_items' (which lists items within modules), leaving some ambiguity in scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing a valid course ID), exclusions, or comparisons to similar tools like 'canvas_get_module' or 'canvas_list_module_items', leaving the agent to infer usage context solely from the tool name and parameters.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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