Skip to main content
Glama

canvas_list_account_users

Retrieve and filter users for a specified account in Canvas LMS by ID, search term, or sort criteria using the MCP server interaction tool.

Instructions

List users for an account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYesID of the account
orderNoSort direction
search_termNoSearch term to filter users
sortNoSort order

Implementation Reference

  • src/index.ts:741-754 (registration)
    Tool registration in the TOOLS array with name 'canvas_list_account_users', description, and input schema definition.
    {
      name: "canvas_list_account_users",
      description: "List users for an account",
      inputSchema: {
        type: "object",
        properties: {
          account_id: { type: "number", description: "ID of the account" },
          search_term: { type: "string", description: "Search term to filter users" },
          sort: { type: "string", enum: ["username", "email", "sis_id", "last_login"], description: "Sort order" },
          order: { type: "string", enum: ["asc", "desc"], description: "Sort direction" }
        },
        required: ["account_id"]
      }
    },
  • MCP tool call handler for 'canvas_list_account_users' that validates input, calls CanvasClient.listAccountUsers, and returns JSON response.
    case "canvas_list_account_users": {
      const accountUsersArgs = args as unknown as ListAccountUsersArgs;
      if (!accountUsersArgs.account_id) {
        throw new Error("Missing required field: account_id");
      }
      
      const users = await this.client.listAccountUsers(accountUsersArgs);
      return {
        content: [{ type: "text", text: JSON.stringify(users, null, 2) }]
      };
    }
  • TypeScript interface defining input arguments for listAccountUsers (account_id required, optional filters). Used in tool schema and client method.
    export interface ListAccountUsersArgs {
      account_id: number;
      search_term?: string;
      enrollment_type?: string;
      sort?: 'username' | 'email' | 'sis_id' | 'last_login';
      order?: 'asc' | 'desc';
      include?: string[];
    }
  • Core CanvasClient method implementing listAccountUsers: extracts account_id and params, makes API GET request to /accounts/{account_id}/users, returns users array.
    async listAccountUsers(args: ListAccountUsersArgs): Promise<CanvasUser[]> {
      const { account_id, ...params } = args;
      const response = await this.client.get(`/accounts/${account_id}/users`, { params });
      return response.data;
    }
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