canvas_list_assignment_groups
Retrieve assignment groups for a specific course using the Canvas LMS API. Input the course ID to manage and organize assignments efficiently within Canvas MCP Server V2.0.
Instructions
List assignment groups for a course
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| course_id | Yes | ID of the course |
Input Schema (JSON Schema)
{
"properties": {
"course_id": {
"description": "ID of the course",
"type": "number"
}
},
"required": [
"course_id"
],
"type": "object"
}
Implementation Reference
- src/client.ts:307-314 (handler)Core handler function that executes the Canvas API request to list assignment groups for a course, including associated assignments.async listAssignmentGroups(courseId: number): Promise<CanvasAssignmentGroup[]> { const response = await this.client.get(`/courses/${courseId}/assignment_groups`, { params: { include: ['assignments'] } }); return response.data; }
- src/index.ts:211-220 (registration)Tool registration in the MCP TOOLS array, including name, description, and input schema.name: "canvas_list_assignment_groups", description: "List assignment groups for a course", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" } }, required: ["course_id"] } },
- src/index.ts:1185-1193 (handler)MCP server handler that processes the tool call, validates input, invokes the client method, and formats the response.case "canvas_list_assignment_groups": { const { course_id } = args as { course_id: number }; if (!course_id) throw new Error("Missing required field: course_id"); const groups = await this.client.listAssignmentGroups(course_id); return { content: [{ type: "text", text: JSON.stringify(groups, null, 2) }] }; }
- src/types.ts:127-134 (schema)Type definition for Canvas assignment groups returned by the tool.export interface CanvasAssignmentGroup { id: number; name: string; position: number; weight: number; assignments?: CanvasAssignment[]; group_weight: number; }