Skip to main content
Glama

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

NameRequiredDescriptionDefault
course_idYesID of the course

Input Schema (JSON Schema)

{ "properties": { "course_id": { "description": "ID of the course", "type": "number" } }, "required": [ "course_id" ], "type": "object" }

Implementation Reference

  • 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"] } },
  • 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) }] }; }
  • 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; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DMontgomery40/mcp-canvas-lms'

If you have feedback or need assistance with the MCP directory API, please join our Discord server