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
| Name | Required | Description | Default |
|---|---|---|---|
| orgUnitId | No | The course ID. Optional if D2L_COURSE_ID env var is set. |
Implementation Reference
- src/tools/dropbox.ts:21-24 (handler)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); },
- src/tools/dropbox.ts:18-20 (schema)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 }] }; } );
- src/tools/dropbox.ts:7-13 (helper)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; }