Skip to main content
Glama

canvas_list_account_courses

Retrieve and filter courses for a specific Canvas account. Manage course lists by publication status, enrollment data, completion status, search terms, and sorting preferences.

Instructions

List courses for an account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYesID of the account
completedNoInclude completed courses
orderNoSort direction
publishedNoOnly include published courses
search_termNoSearch term to filter courses
sortNoSort order
with_enrollmentsNoInclude enrollment data

Implementation Reference

  • Core handler function implementing the Canvas API call to list courses for a specific account.
    async listAccountCourses(args: ListAccountCoursesArgs): Promise<CanvasCourse[]> {
      const { account_id, ...params } = args;
      const response = await this.client.get(`/accounts/${account_id}/courses`, { params });
      return response.data;
    }
  • MCP tool call handler that validates input and delegates to CanvasClient.listAccountCourses.
    case "canvas_list_account_courses": {
      const accountCoursesArgs = args as unknown as ListAccountCoursesArgs;
      if (!accountCoursesArgs.account_id) {
        throw new Error("Missing required field: account_id");
      }
      
      const courses = await this.client.listAccountCourses(accountCoursesArgs);
      return {
        content: [{ type: "text", text: JSON.stringify(courses, null, 2) }]
      };
    }
  • src/index.ts:725-740 (registration)
    Tool registration in the MCP TOOLS array, defining name, description, and input schema.
      name: "canvas_list_account_courses",
      description: "List courses for an account",
      inputSchema: {
        type: "object",
        properties: {
          account_id: { type: "number", description: "ID of the account" },
          with_enrollments: { type: "boolean", description: "Include enrollment data" },
          published: { type: "boolean", description: "Only include published courses" },
          completed: { type: "boolean", description: "Include completed courses" },
          search_term: { type: "string", description: "Search term to filter courses" },
          sort: { type: "string", enum: ["course_name", "sis_course_id", "teacher", "account_name"], description: "Sort order" },
          order: { type: "string", enum: ["asc", "desc"], description: "Sort direction" }
        },
        required: ["account_id"]
      }
    },
  • TypeScript interface defining the input parameters for the listAccountCourses tool.
    export interface ListAccountCoursesArgs {
      account_id: number;
      with_enrollments?: boolean;
      enrollment_type?: string[];
      published?: boolean;
      completed?: boolean;
      blueprint?: boolean;
      blueprint_associated?: boolean;
      by_teachers?: number[];
      by_subaccounts?: number[];
      hide_enrollmentless_courses?: boolean;
      state?: ('created' | 'claimed' | 'available' | 'completed' | 'deleted' | 'all')[];
      enrollment_term_id?: number;
      search_term?: string;
      include?: string[];
      sort?: 'course_name' | 'sis_course_id' | 'teacher' | 'account_name';
      order?: 'asc' | 'desc';
      search_by?: 'course' | 'teacher';
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'List courses' which implies a read-only operation, but doesn't disclose behavioral traits like pagination, rate limits, authentication requirements, error conditions, or what the return format looks like. For a tool with 7 parameters and no output schema, this leaves significant gaps in understanding how it behaves.

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 states the core purpose without unnecessary words. It's appropriately sized and front-loaded, with every word earning its place in conveying the essential function.

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 tool's complexity (7 parameters, no annotations, no output schema), the description is insufficiently complete. It doesn't explain what the tool returns, how results are structured, whether there are limitations or side effects, or how it differs from similar listing tools. For a data retrieval tool with multiple filtering options, more context is needed to use it effectively.

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%, so the schema already documents all 7 parameters thoroughly. The description adds no additional meaning about parameters beyond implying account-based filtering. With complete schema documentation, the baseline score of 3 is appropriate as the description doesn't compensate but doesn't need to given the comprehensive schema.

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 verb ('List') and resource ('courses for an account'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'canvas_list_courses' or 'canvas_list_account_users', which would require specifying scope or filtering criteria unique to this tool.

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. With siblings like 'canvas_list_courses' (likely listing all courses) and 'canvas_list_account_users' (listing users in an account), there's no indication of context, prerequisites, or exclusions for this account-specific course listing tool.

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