canvas_create_account_report
Generate detailed reports for Canvas accounts by specifying the account ID and report type, enabling effective management of courses, assignments, enrollments, and grades.
Instructions
Generate a report for an account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ID of the account | |
| parameters | No | Report parameters | |
| report | Yes | Type of report to generate |
Implementation Reference
- src/index.ts:1439-1449 (handler)The main handler for the 'canvas_create_account_report' tool in the MCP server's CallToolRequestSchema handler. Validates input and calls CanvasClient.createAccountReport.case "canvas_create_account_report": { const createReportArgs = args as unknown as CreateReportArgs; if (!createReportArgs.account_id || !createReportArgs.report) { throw new Error("Missing required fields: account_id and report"); } const report = await this.client.createAccountReport(createReportArgs); return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] }; }
- src/index.ts:809-820 (registration)Tool registration entry in the TOOLS array, defining name, description, and input schema for listTools.name: "canvas_create_account_report", description: "Generate a report for an account", inputSchema: { type: "object", properties: { account_id: { type: "number", description: "ID of the account" }, report: { type: "string", description: "Type of report to generate" }, parameters: { type: "object", description: "Report parameters" } }, required: ["account_id", "report"] } }
- src/types.ts:775-779 (schema)TypeScript interface defining the input parameters for createAccountReport, matching the tool's inputSchema.export interface CreateReportArgs { account_id: number; report: string; parameters?: Record<string, any>; }
- src/client.ts:790-796 (helper)Core CanvasClient method that makes the API POST request to create an account report.async createAccountReport(args: CreateReportArgs): Promise<CanvasAccountReport> { const { account_id, report, parameters } = args; const response = await this.client.post(`/accounts/${account_id}/reports/${report}`, { parameters: parameters || {} }); return response.data; }
- src/types.ts:761-773 (schema)TypeScript interface for the CanvasAccountReport return type.export 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; }