canvas_create_course
Create and configure new courses in Canvas by specifying account ID, name, course code, dates, and other settings such as visibility, enrollment, and syllabus details.
Instructions
Create a new course in Canvas
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes | ID of the account to create the course in | |
| allow_student_forum_attachments | No | Whether students can add forum attachments | |
| allow_student_wiki_edits | No | Whether students can edit the wiki | |
| allow_wiki_comments | No | Whether wiki comments are allowed | |
| apply_assignment_group_weights | No | Whether to apply assignment group weights | |
| course_code | No | Course code (e.g., CS101) | |
| end_at | No | Course end date (ISO format) | |
| hide_final_grades | No | Whether to hide final grades | |
| integration_id | No | Integration ID for the course | |
| is_public | No | Whether the course is public | |
| is_public_to_auth_users | No | Whether the course is public to authenticated users | |
| license | No | Course license | |
| name | Yes | Name of the course | |
| open_enrollment | No | Whether the course has open enrollment | |
| public_description | No | Public description of the course | |
| public_syllabus | No | Whether the syllabus is public | |
| public_syllabus_to_auth | No | Whether the syllabus is public to authenticated users | |
| restrict_enrollments_to_course_dates | No | Whether to restrict enrollments to course start/end dates | |
| self_enrollment | No | Whether the course allows self enrollment | |
| sis_course_id | No | SIS course ID | |
| start_at | No | Course start date (ISO format) | |
| syllabus_body | No | Course syllabus content | |
| term_id | No | ID of the enrollment term | |
| time_zone | No | Course time zone |
Implementation Reference
- src/index.ts:73-106 (registration)Registration of the 'canvas_create_course' tool including its input schema definition in the TOOLS array.{ name: "canvas_create_course", description: "Create a new course in Canvas", inputSchema: { type: "object", properties: { account_id: { type: "number", description: "ID of the account to create the course in" }, name: { type: "string", description: "Name of the course" }, course_code: { type: "string", description: "Course code (e.g., CS101)" }, start_at: { type: "string", description: "Course start date (ISO format)" }, end_at: { type: "string", description: "Course end date (ISO format)" }, license: { type: "string", description: "Course license" }, is_public: { type: "boolean", description: "Whether the course is public" }, is_public_to_auth_users: { type: "boolean", description: "Whether the course is public to authenticated users" }, public_syllabus: { type: "boolean", description: "Whether the syllabus is public" }, public_syllabus_to_auth: { type: "boolean", description: "Whether the syllabus is public to authenticated users" }, public_description: { type: "string", description: "Public description of the course" }, allow_student_wiki_edits: { type: "boolean", description: "Whether students can edit the wiki" }, allow_wiki_comments: { type: "boolean", description: "Whether wiki comments are allowed" }, allow_student_forum_attachments: { type: "boolean", description: "Whether students can add forum attachments" }, open_enrollment: { type: "boolean", description: "Whether the course has open enrollment" }, self_enrollment: { type: "boolean", description: "Whether the course allows self enrollment" }, restrict_enrollments_to_course_dates: { type: "boolean", description: "Whether to restrict enrollments to course start/end dates" }, term_id: { type: "number", description: "ID of the enrollment term" }, sis_course_id: { type: "string", description: "SIS course ID" }, integration_id: { type: "string", description: "Integration ID for the course" }, hide_final_grades: { type: "boolean", description: "Whether to hide final grades" }, apply_assignment_group_weights: { type: "boolean", description: "Whether to apply assignment group weights" }, time_zone: { type: "string", description: "Course time zone" }, syllabus_body: { type: "string", description: "Course syllabus content" } }, required: ["account_id", "name"] } },
- src/index.ts:1111-1120 (handler)MCP tool handler for 'canvas_create_course' that validates input and delegates to CanvasClient.createCourse method.case "canvas_create_course": { const courseArgs = args as unknown as CreateCourseArgs; if (!courseArgs.account_id || !courseArgs.name) { throw new Error("Missing required fields: account_id and name"); } const course = await this.client.createCourse(courseArgs); return { content: [{ type: "text", text: JSON.stringify(course, null, 2) }] }; }
- src/client.ts:234-240 (handler)Core implementation of course creation in CanvasClient using Canvas API POST /accounts/{account_id}/courses.async createCourse(args: CreateCourseArgs): Promise<CanvasCourse> { const { account_id, ...courseData } = args; const response = await this.client.post(`/accounts/${account_id}/courses`, { course: courseData }); return response.data; }
- src/types.ts:547-572 (schema)TypeScript interface defining input parameters for createCourse (used by both tool handler and client).export interface CreateCourseArgs { account_id: number; name: string; course_code?: string; start_at?: string; end_at?: string; license?: string; is_public?: boolean; is_public_to_auth_users?: boolean; public_syllabus?: boolean; public_syllabus_to_auth?: boolean; public_description?: string; allow_student_wiki_edits?: boolean; allow_wiki_comments?: boolean; allow_student_forum_attachments?: boolean; open_enrollment?: boolean; self_enrollment?: boolean; restrict_enrollments_to_course_dates?: boolean; term_id?: number; sis_course_id?: string; integration_id?: string; hide_final_grades?: boolean; apply_assignment_group_weights?: boolean; time_zone?: string; syllabus_body?: string; }