Skip to main content
Glama

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
NameRequiredDescriptionDefault
orgUnitIdNoThe course ID. Optional if D2L_COURSE_ID env var is set.
assignmentIdYesThe assignment Id from get_assignments. Example: 37812

Implementation Reference

  • 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);
    },
  • 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 }] };
      }
    );
  • 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;
    }

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