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
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ID of the account | |
| order | No | Sort direction | |
| search_term | No | Search term to filter users | |
| sort | No | Sort order |
Input Schema (JSON Schema)
{
"properties": {
"account_id": {
"description": "ID of the account",
"type": "number"
},
"order": {
"description": "Sort direction",
"enum": [
"asc",
"desc"
],
"type": "string"
},
"search_term": {
"description": "Search term to filter users",
"type": "string"
},
"sort": {
"description": "Sort order",
"enum": [
"username",
"email",
"sis_id",
"last_login"
],
"type": "string"
}
},
"required": [
"account_id"
],
"type": "object"
}
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"] } },
- src/index.ts:1395-1405 (handler)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) }] }; }
- src/types.ts:801-808 (schema)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[]; }
- src/client.ts:765-769 (handler)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; }