get_course_content
Retrieve the complete course syllabus including modules, topics, lectures, assignments, and learning materials to understand course structure and available content.
Instructions
Get the complete course syllabus/structure including all modules, topics, lectures, and learning materials. Returns module titles, descriptions, topic names with URLs, and linked assignments. Use to answer: "What's in this course?", "Show me the syllabus", "What topics are covered?", "What lectures are available?", "What reading materials do I have?"
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orgUnitId | No | The course ID. Optional if D2L_COURSE_ID env var is set. |
Implementation Reference
- src/tools/content.ts:21-24 (handler)The async handler function that implements the core logic of the get_course_content tool. It retrieves the course table of contents (TOC) using the client and marshals it into a formatted JSON string.handler: async ({ orgUnitId }: { orgUnitId?: number }) => { const toc = await client.getContentToc(getOrgUnitId(orgUnitId)) as { Modules: RawTocModule[] }; return JSON.stringify(marshalToc(toc), null, 2); },
- src/tools/content.ts:18-20 (schema)Zod input schema defining the optional orgUnitId parameter for the get_course_content tool.schema: { orgUnitId: z.number().optional().describe('The course ID. Optional if D2L_COURSE_ID env var is set.'), },
- src/index.ts:56-64 (registration)MCP server registration of the get_course_content tool, which wraps the handler and formats the response as MCP content.server.tool( 'get_course_content', contentTools.get_course_content.description, { orgUnitId: contentTools.get_course_content.schema.orgUnitId }, async (args) => { const result = await contentTools.get_course_content.handler(args as { orgUnitId?: number }); return { content: [{ type: 'text', text: result }] }; } );
- src/tools/content.ts:7-13 (helper)Helper utility function used by the handler to resolve the course orgUnitId from parameter or environment variable.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; }