canvas_get_account_reports
Retrieve available reports for a specific Canvas account using its ID, enabling efficient management and analysis of course and user data.
Instructions
List available reports for an account
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ID of the account |
Input Schema (JSON Schema)
{
"properties": {
"account_id": {
"description": "ID of the account",
"type": "number"
}
},
"required": [
"account_id"
],
"type": "object"
}
Implementation Reference
- src/index.ts:797-807 (registration)Tool registration in TOOLS array defining name, description, and input schema{ name: "canvas_get_account_reports", description: "List available reports for an account", inputSchema: { type: "object", properties: { account_id: { type: "number", description: "ID of the account" } }, required: ["account_id"] } },
- src/index.ts:1429-1437 (handler)Tool handler dispatch in CallToolRequestSchema switch statement, validates args and calls client methodcase "canvas_get_account_reports": { const { account_id } = args as { account_id: number }; if (!account_id) throw new Error("Missing required field: account_id"); const reports = await this.client.getAccountReports(account_id); return { content: [{ type: "text", text: JSON.stringify(reports, null, 2) }] }; }
- src/client.ts:785-788 (handler)Core handler implementation in CanvasClient - makes API call to /accounts/{accountId}/reports and returns dataasync getAccountReports(accountId: number): Promise<any[]> { const response = await this.client.get(`/accounts/${accountId}/reports`); return response.data; }
- src/types.ts:761-774 (schema)Type definition for CanvasAccountReport - output schema for account reportsexport interface CanvasAccountReport { id: number; report: string; file_url?: string; attachment?: CanvasFile; status: 'created' | 'running' | 'complete' | 'error'; created_at: string; started_at?: string; ended_at?: string; parameters: Record<string, any>; progress: number; current_line?: number; }
- src/index.ts:800-806 (schema)Input schema definition for the tool - requires account_id as numberinputSchema: { type: "object", properties: { account_id: { type: "number", description: "ID of the account" } }, required: ["account_id"] }