Skip to main content
Glama

canvas_get_assignment

Retrieve detailed information about a specific assignment from the Canvas LMS, including optional submission data, by providing course and assignment IDs.

Instructions

Get detailed information about a specific assignment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assignment_idYesID of the assignment
course_idYesID of the course
include_submissionNoInclude user's submission data

Implementation Reference

  • src/index.ts:152-164 (registration)
    Tool registration and input schema definition for canvas_get_assignment in the static TOOLS array used by ListToolsRequestSchema
    {
      name: "canvas_get_assignment",
      description: "Get detailed information about a specific assignment",
      inputSchema: {
        type: "object",
        properties: {
          course_id: { type: "number", description: "ID of the course" },
          assignment_id: { type: "number", description: "ID of the assignment" },
          include_submission: { type: "boolean", description: "Include user's submission data" }
        },
        required: ["course_id", "assignment_id"]
      }
    },
  • Main handler logic for the canvas_get_assignment tool call within CallToolRequestSchema handler, validates args and delegates to CanvasClient.getAssignment
    case "canvas_get_assignment": {
      const { course_id, assignment_id, include_submission = false } = args as { 
        course_id: number; 
        assignment_id: number;
        include_submission?: boolean;
      };
      if (!course_id || !assignment_id) {
        throw new Error("Missing required fields: course_id and assignment_id");
      }
      
      const assignment = await this.client.getAssignment(course_id, assignment_id, include_submission);
      return {
        content: [{ type: "text", text: JSON.stringify(assignment, null, 2) }]
      };
    }
  • CanvasClient.getAssignment method: makes the actual Canvas API GET request to retrieve assignment details with optional submission inclusion
    async getAssignment(courseId: number, assignmentId: number, includeSubmission: boolean = false): Promise<CanvasAssignment> {
      const params: any = {
        include: ['assignment_group', 'rubric']
      };
      
      if (includeSubmission) {
        params.include.push('submission');
      }
    
      const response = await this.client.get(`/courses/${courseId}/assignments/${assignmentId}`, { params });
      return response.data;
    }
  • TypeScript interface defining the CanvasAssignment return type used by the tool
    export interface CanvasAssignment {
      readonly id: AssignmentId;
      readonly course_id: CourseId;
      readonly name: string;
      readonly description: string;
      readonly due_at: string | null;
      readonly lock_at: string | null;
      readonly unlock_at: string | null;
      readonly points_possible: number;
      readonly position: number;
      readonly submission_types: ReadonlyArray<CanvasSubmissionType>;
      readonly assignment_group_id: number;
      readonly assignment_group?: CanvasAssignmentGroup;
      readonly rubric?: CanvasRubric[];
      readonly rubric_settings?: CanvasRubricSettings;
      readonly allowed_extensions?: string[];
      readonly submission?: CanvasSubmission;
      readonly html_url: string;
      readonly published: boolean;
      readonly grading_type: CanvasGradingType;
    }
  • Registration handler that returns the TOOLS list containing canvas_get_assignment to MCP clients
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS
    }));
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It doesn't disclose whether this is a read-only operation (implied by 'Get' but not explicit), authentication requirements, rate limits, error conditions, or what 'detailed information' includes. The description doesn't contradict annotations (none exist), but fails to provide necessary context for safe and effective use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence with zero wasted words. It's front-loaded with the core purpose and efficiently communicates the essential function. Every word earns its place, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 3 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what 'detailed information' includes, whether authentication is required, error handling, or how the include_submission parameter affects results. Given the complexity of educational data and lack of structured safety hints, more behavioral context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain relationships between parameters (e.g., that assignment_id must belong to the specified course_id) or provide examples of valid IDs. The baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('detailed information about a specific assignment'), making the purpose immediately understandable. It distinguishes from siblings like canvas_list_assignments (which lists multiple) and canvas_get_submission (which focuses on submissions). However, it doesn't explicitly contrast with canvas_get_upcoming_assignments or canvas_get_course_grades, which could provide overlapping assignment data in different contexts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to prefer canvas_get_submission (for submission details), canvas_get_upcoming_assignments (for future assignments), or canvas_get_course_grades (which might include assignment grades). There's also no mention of prerequisites like needing course context first.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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