Skip to main content
Glama

canvas_create_quiz

Create and manage quizzes in Canvas courses by specifying course ID, title, type, time limit, and due date. Publish quizzes directly with a description for structured assessments.

Instructions

Create a new quiz in a course

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_idYesID of the course
descriptionNoDescription of the quiz
due_atNoDue date (ISO format)
publishedNoIs the quiz published
quiz_typeNoType of the quiz (e.g., graded)
time_limitNoTime limit in minutes
titleYesTitle of the quiz

Implementation Reference

  • src/index.ts:570-623 (registration)
    Registration of canvas quiz tools including canvas_create_quiz with input schema
    // Quizzes { name: "canvas_list_quizzes", description: "List all quizzes in a course", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" } }, required: ["course_id"] } }, { name: "canvas_get_quiz", description: "Get details of a specific quiz", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" }, quiz_id: { type: "number", description: "ID of the quiz" } }, required: ["course_id", "quiz_id"] } }, { name: "canvas_create_quiz", description: "Create a new quiz in a course", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" }, title: { type: "string", description: "Title of the quiz" }, quiz_type: { type: "string", description: "Type of the quiz (e.g., graded)" }, time_limit: { type: "number", description: "Time limit in minutes" }, published: { type: "boolean", description: "Is the quiz published" }, description: { type: "string", description: "Description of the quiz" }, due_at: { type: "string", description: "Due date (ISO format)" } }, required: ["course_id", "title"] } }, { name: "canvas_start_quiz_attempt", description: "Start a new quiz attempt", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" }, quiz_id: { type: "number", description: "ID of the quiz" } }, required: ["course_id", "quiz_id"] } },
  • Handler logic for creating a quiz using Canvas API POST request
    async createQuiz(courseId: number, quizData: Partial<CanvasQuiz>): Promise<CanvasQuiz> { const response = await this.client.post(`/courses/${courseId}/quizzes`, { quiz: quizData }); return response.data; }
  • Type definition for CanvasQuiz used in createQuiz
    export interface CanvasQuiz { id: number; title: string; html_url: string; quiz_type: CanvasQuizType; assignment_id?: number; time_limit: number | null; published: boolean; description: string | null; due_at: string | null; lock_at: string | null; unlock_at: string | null; points_possible: number; question_count: number; allowed_attempts: number; scoring_policy: 'keep_highest' | 'keep_latest'; show_correct_answers: boolean; show_correct_answers_at: string | null; hide_correct_answers_at: string | null; shuffle_answers: boolean; has_access_code: boolean; ip_filter?: string; locked_for_user: boolean; lock_explanation?: string; }
  • Input schema definition for the canvas_create_quiz tool
    name: "canvas_create_quiz", description: "Create a new quiz in a course", inputSchema: { type: "object", properties: { course_id: { type: "number", description: "ID of the course" }, title: { type: "string", description: "Title of the quiz" }, quiz_type: { type: "string", description: "Type of the quiz (e.g., graded)" }, time_limit: { type: "number", description: "Time limit in minutes" }, published: { type: "boolean", description: "Is the quiz published" }, description: { type: "string", description: "Description of the quiz" }, due_at: { type: "string", description: "Due date (ISO format)" } }, required: ["course_id", "title"] } },
  • src/index.ts:1071-1075 (registration)
    Registration of all tools list handler which includes canvas_create_quiz
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS })); // Handle tool calls with comprehensive error handling
Install Server

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