canvas_get_account
Retrieve detailed account information from the Canvas Learning Management System by providing the account ID, enabling efficient management and integration with Canvas resources.
Instructions
Get account details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ID of the account |
Implementation Reference
- src/client.ts:754-757 (handler)Core handler function that makes the Canvas API call to retrieve account details by ID.
async getAccount(accountId: number): Promise<CanvasAccount> { const response = await this.client.get(`/accounts/${accountId}`); return response.data; } - src/index.ts:714-722 (registration)Tool registration in the TOOLS array, defining name, description, and input schema.
name: "canvas_get_account", description: "Get account details", inputSchema: { type: "object", properties: { account_id: { type: "number", description: "ID of the account" } }, required: ["account_id"] } - src/index.ts:1373-1381 (handler)MCP server handler that validates input and delegates to CanvasClient.getAccount.
case "canvas_get_account": { const { account_id } = args as { account_id: number }; if (!account_id) throw new Error("Missing required field: account_id"); const account = await this.client.getAccount(account_id); return { content: [{ type: "text", text: JSON.stringify(account, null, 2) }] }; } - src/types.ts:714-729 (schema)TypeScript interface defining the structure of CanvasAccount response data.
export interface CanvasAccount { id: number; name: string; uuid: string; parent_account_id: number | null; root_account_id: number | null; default_storage_quota_mb: number; default_user_storage_quota_mb: number; default_group_storage_quota_mb: number; default_time_zone: string; sis_account_id: string | null; integration_id: string | null; sis_import_id: number | null; lti_guid: string; workflow_state: string; }