Skip to main content
Glama

canvas_create_assignment

Create and configure assignments in Canvas courses with specific details like name, description, due date, points, submission types, and file extensions directly via the Canvas MCP Server V2.0.

Instructions

Create a new assignment in a Canvas course

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allowed_extensionsNoAllowed file extensions for submissions
course_idYesID of the course
descriptionNoAssignment description/instructions
due_atNoDue date (ISO format)
nameYesName of the assignment
points_possibleNoMaximum points possible
publishedNoWhether the assignment is published
submission_typesNoAllowed submission types

Implementation Reference

  • Core implementation of the assignment creation logic, making the POST request to Canvas API endpoint /courses/{course_id}/assignments
    async createAssignment(args: CreateAssignmentArgs): Promise<CanvasAssignment> { const { course_id, ...assignmentData } = args; const response = await this.client.post(`/courses/${course_id}/assignments`, { assignment: assignmentData }); return response.data; }
  • MCP server tool handler for canvas_create_assignment: validates arguments and delegates to CanvasClient
    case "canvas_create_assignment": { const assignmentArgs = args as unknown as CreateAssignmentArgs; if (!assignmentArgs.course_id || !assignmentArgs.name) { throw new Error("Missing required fields: course_id and name"); } const assignment = await this.client.createAssignment(assignmentArgs); return { content: [{ type: "text", text: JSON.stringify(assignment, null, 2) }] }; }
  • src/index.ts:166-189 (registration)
    Tool registration in the TOOLS array, including name, description, and input schema
    name: "canvas_create_assignment", description: "Create a new assignment in a Canvas course", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" }, name: { type: "string", description: "Name of the assignment" }, description: { type: "string", description: "Assignment description/instructions" }, due_at: { type: "string", description: "Due date (ISO format)" }, points_possible: { type: "number", description: "Maximum points possible" }, submission_types: { type: "array", items: { type: "string" }, description: "Allowed submission types" }, allowed_extensions: { type: "array", items: { type: "string" }, description: "Allowed file extensions for submissions" }, published: { type: "boolean", description: "Whether the assignment is published" } }, required: ["course_id", "name"] }
  • TypeScript interface defining the structure of CreateAssignmentArgs used for type safety and validation
    export interface CreateAssignmentArgs { course_id: number; name: string; description?: string; due_at?: string; lock_at?: string; unlock_at?: string; points_possible?: number; grading_type?: CanvasGradingType; submission_types?: CanvasSubmissionType[]; allowed_extensions?: string[]; assignment_group_id?: number; position?: number; peer_reviews?: boolean; automatic_peer_reviews?: boolean; notify_of_update?: boolean; group_category_id?: number; published?: boolean; omit_from_final_grade?: boolean; hide_in_gradebook?: boolean; }

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