Skip to main content
Glama

canvas_list_courses

Retrieve a list of all courses for the current user in Canvas, with the option to include ended courses, enabling efficient course management and navigation within the learning management system.

Instructions

List all courses for the current user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_endedNoInclude ended courses

Implementation Reference

  • src/index.ts:51-61 (registration)
    Registration of the canvas_list_courses tool in the TOOLS array, including name, description, and input schema.
    {
      name: "canvas_list_courses",
      description: "List all courses for the current user",
      inputSchema: {
        type: "object",
        properties: {
          include_ended: { type: "boolean", description: "Include ended courses" }
        },
        required: []
      }
    },
  • MCP server handler that processes the tool call, extracts arguments, calls CanvasClient.listCourses, and returns JSON response.
    case "canvas_list_courses": {
      const { include_ended = false } = args as { include_ended?: boolean };
      const courses = await this.client.listCourses(include_ended);
      return {
        content: [{ type: "text", text: JSON.stringify(courses, null, 2) }]
      };
    }
  • Core implementation in CanvasClient that makes the API call to Canvas /courses endpoint with appropriate parameters based on includeEnded flag.
    async listCourses(includeEnded: boolean = false): Promise<CanvasCourse[]> {
      const params: any = {
        include: ['total_students', 'teachers', 'term', 'course_progress']
      };
      
      if (!includeEnded) {
        params.state = ['available', 'completed'];
      }
    
      const response = await this.client.get('/courses', { params });
      return response.data;
    }
  • TypeScript interface defining the CanvasCourse type returned by the listCourses method.
    export interface CanvasCourse {
      readonly id: CourseId;
      readonly name: string;
      readonly course_code: string;
      readonly workflow_state: CanvasCourseState;
      readonly account_id: number;
      readonly start_at: string | null;
      readonly end_at: string | null;
      readonly enrollments?: ReadonlyArray<CanvasEnrollment>;
      readonly total_students?: number;
      readonly syllabus_body?: string;
      readonly term?: CanvasTerm;
      readonly course_progress?: CanvasCourseProgress;
    }
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 courses but fails to describe key behaviors like pagination, rate limits, authentication needs, or what 'current user' entails (e.g., based on token context). 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 directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with no wasted content.

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 cover behavioral aspects like return format, error handling, or user context, which are crucial for a list operation. The tool's complexity is low, but the description fails to provide sufficient context for safe and effective use.

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?

Schema description coverage is 100%, with the single parameter 'include_ended' well-documented in the schema. The description does not add any parameter semantics beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without compensating value.

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 clearly states the action ('List') and resource ('courses for the current user'), making the purpose specific and understandable. However, it does not explicitly differentiate from its sibling 'canvas_list_account_courses', which might list courses at an account level rather than user-specific, leaving some ambiguity in sibling distinction.

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, such as 'canvas_list_account_courses' or 'canvas_get_course'. There is no mention of prerequisites, context, or exclusions, leaving the agent without usage direction.

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