Skip to main content
Glama

list_modules

Retrieve all modules for a Canvas course, optionally including their items.

Instructions

Course modules with items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYes
with_itemsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `list_modules` function that executes the tool logic. It takes a course_id and optional with_items flag, calls the Canvas /api/v1/courses/{course_id}/modules endpoint, optionally including items via the 'include[]' parameter.
    @mcp.tool()
    def list_modules(course_id: int, with_items: bool = True) -> list[dict]:
        """Course modules with items."""
        params = {}
        if with_items:
            params["include[]"] = "items"
        return _get(f"/api/v1/courses/{course_id}/modules", **params)
  • The `@mcp.tool()` decorator on line 100 registers this function as an MCP tool named 'list_modules' with FastMCP.
    @mcp.tool()
    def list_modules(course_id: int, with_items: bool = True) -> list[dict]:
        """Course modules with items."""
        params = {}
        if with_items:
            params["include[]"] = "items"
        return _get(f"/api/v1/courses/{course_id}/modules", **params)
Behavior2/5

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

Without annotations, the description bears full responsibility for behavioral disclosure. It does not mention read-only nature, pagination, sorting, or any side effects. The simple phrase 'with items' hints at output structure but lacks detail.

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

Conciseness2/5

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

Though extremely concise (3 words), this result is under-specification rather than efficient communication. The description lacks structure and fails to earn its place by providing essential context.

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 only 2 parameters and an existing output schema, the description is still incomplete. It does not describe the purpose of 'with_items', the type of items returned, or any special behavior. The agent needs more to use this tool correctly.

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

Parameters2/5

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

The input schema has 0% description coverage. The description adds almost no meaning beyond parameter names; 'with_items' is vaguely referenced by 'items', but 'course_id' is not elaborated. The description does not clarify parameter roles or constraints.

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

Purpose3/5

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

The description 'Course modules with items' vaguely indicates the tool deals with modules and items but does not explicitly state the action (listing). The name 'list_modules' clarifies, but siblings like 'list_announcements' and 'list_assignments' suggest a pattern, so it is somewhat clear but minimal.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_page' or 'list_assignments'. There is no context about prerequisites, limitations, or recommended scenarios.

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

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/admin978/canvas-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server