Skip to main content
Glama

get_assignments

Retrieve course assignments with due dates, instructions, and point values to track deadlines and access assignment details.

Instructions

List all assignments for a course with their due dates and instructions. Returns: Name, DueDate (ISO 8601 format - compare with current date to find upcoming/overdue), instructions (in CustomInstructions.Text), point value (Assessment.ScoreDenominator), and Id (needed for get_assignment_submissions). Use this to answer: "What assignments do I have?", "What's due this week?", "What are my upcoming deadlines?", "Show me assignment instructions", "What homework is due soon?"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orgUnitIdNoThe course ID. Optional if D2L_COURSE_ID env var is set.

Implementation Reference

  • The handler function that implements the core logic of the 'get_assignments' tool. It retrieves Dropbox folders for the given organization unit ID using the client, marshals them into assignments, and returns a JSON string.
    handler: async ({ orgUnitId }: { orgUnitId?: number }) => { const folders = await client.getDropboxFolders(getOrgUnitId(orgUnitId)) as RawAssignment[]; return JSON.stringify(marshalAssignments(folders), null, 2); },
  • Zod schema defining the input parameters for the 'get_assignments' tool, specifically the optional orgUnitId.
    schema: { orgUnitId: z.number().optional().describe('The course ID. Optional if D2L_COURSE_ID env var is set.'), },
  • src/index.ts:19-27 (registration)
    Registration of the 'get_assignments' tool with the MCP server, wrapping the handler to return formatted content.
    server.tool( 'get_assignments', assignmentTools.get_assignments.description, { orgUnitId: assignmentTools.get_assignments.schema.orgUnitId }, async (args) => { const result = await assignmentTools.get_assignments.handler(args as { orgUnitId?: number }); return { content: [{ type: 'text', text: result }] }; } );
  • Helper function used by the handler to resolve the organization unit ID, falling back to environment variable if not provided.
    function getOrgUnitId(orgUnitId?: number): number { const id = orgUnitId ?? DEFAULT_COURSE_ID; if (!id) { throw new Error('No course ID provided and D2L_COURSE_ID environment variable not set'); } return id; }

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/bencered/d2l-mcp-server'

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