get_assignment
Retrieve detailed assignment information including instructions, due dates, point values, file requirements, and grading rubrics from D2L Brightspace courses.
Instructions
Get full details about a specific assignment including complete instructions, due date, point value, allowed file types, and grading rubrics. Use after get_assignments when you need more detail about one assignment.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orgUnitId | No | The course ID. Optional if D2L_COURSE_ID env var is set. | |
| assignmentId | Yes | The assignment Id from get_assignments. Example: 37812 |
Implementation Reference
- src/tools/dropbox.ts:33-36 (handler)Handler function that fetches the specific assignment (Dropbox folder) details using the client and returns marshaled JSON.handler: async ({ orgUnitId, assignmentId }: { orgUnitId?: number; assignmentId: number }) => { const folder = await client.getDropboxFolder(getOrgUnitId(orgUnitId), assignmentId) as RawAssignment; return JSON.stringify(marshalAssignment(folder), null, 2); },
- src/tools/dropbox.ts:29-32 (schema)Zod input schema defining parameters orgUnitId (optional) and required assignmentId.schema: { orgUnitId: z.number().optional().describe('The course ID. Optional if D2L_COURSE_ID env var is set.'), assignmentId: z.number().describe('The assignment Id from get_assignments. Example: 37812'), },
- src/index.ts:29-40 (registration)MCP server registration of the 'get_assignment' tool, referencing the description and schema from assignmentTools, and wrapping the handler to return formatted content.server.tool( 'get_assignment', assignmentTools.get_assignment.description, { orgUnitId: assignmentTools.get_assignment.schema.orgUnitId, assignmentId: assignmentTools.get_assignment.schema.assignmentId, }, async (args) => { const result = await assignmentTools.get_assignment.handler(args as { orgUnitId?: number; assignmentId: number }); return { content: [{ type: 'text', text: result }] }; } );
- src/tools/dropbox.ts:7-13 (helper)Helper function to resolve orgUnitId from parameter or env var.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; }