get_course_versions
Retrieve historical versions of Swedish educational courses to track curriculum changes, compare old and new syllabi, and analyze how requirements and content have evolved over time.
Instructions
Hämta alla versioner av en kurs.
ANVÄNDNINGSFALL:
Spåra förändringar i kursen över tid
Jämföra gamla och nya läroplaner
Forskning och analys
Förstå hur krav och innehåll utvecklats
RETURNERAR: Versionshistorik med versionsnummer och datum.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Implementation Reference
- src/tools/syllabus/courses.ts:107-136 (handler)The main execution logic for the 'get_course_versions' tool. It calls the syllabus API, formats the response as JSON, handles errors, and returns MCP-compatible content.export async function getCourseVersions(params: { code: string; }) { try { const versions = await syllabusApi.getCourseVersions(params.code); return { content: [ { type: 'text' as const, text: JSON.stringify({ code: params.code, totalVersions: versions.totalElements, versions: versions.versions }, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Fel vid hämtning av kursversioner: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
- src/tools/syllabus/courses.ts:23-25 (schema)Zod schema for validating the input parameters (course code) of the get_course_versions tool.export const getCourseVersionsSchema = { code: z.string().describe('Kurskod att hämta versioner för') };
- src/http-server.ts:58-58 (registration)Registration of the tool handler in the central tools registry object, mapping 'get_course_versions' to the getCourseVersions function.get_course_versions: getCourseVersions,
- src/http-server.ts:23-23 (registration)Import statement bringing the getCourseVersions handler into the http-server module for registration.import { searchCourses, getCourseDetails, getCourseVersions } from './tools/syllabus/courses.js';
- src/api/syllabus-client.ts:72-74 (helper)Helper API client method that makes the HTTP GET request to Skolverket's syllabus API to retrieve versions for a specific course code.async getCourseVersions(code: string): Promise<VersionsResponse> { return this.get<VersionsResponse>(`/v1/courses/${code}/versions`); }