get_curriculum_versions
Retrieve version history for Swedish curricula to track revisions, compare different versions, and support educational research on curriculum development.
Instructions
Hämta versionshistorik för en läroplan.
ANVÄNDNINGSFALL:
Spåra revideringar av läroplaner
Jämföra olika versioner
Forskning om läroplansutveckling
RETURNERAR: Lista över versioner med datum.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Implementation Reference
- src/tools/syllabus/curriculums.ts:96-125 (handler)The primary handler function implementing the logic for the 'get_curriculum_versions' tool. It invokes the syllabus API client, processes the response into MCP-compatible content, and handles errors gracefully.export async function getCurriculumVersions(params: { code: string; }) { try { const versions = await syllabusApi.getCurriculumVersions(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 läroplansversioner: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
- Zod input schema for the tool, validating the required 'code' parameter as a string with description.export const getCurriculumVersionsSchema = { code: z.string().describe('Läroplanskod att hämta versioner för') };
- src/http-server.ts:64-64 (registration)Tool registration in the HTTP server's tools registry, mapping the string name 'get_curriculum_versions' to the handler function.get_curriculum_versions: getCurriculumVersions,
- src/api/syllabus-client.ts:106-108 (helper)API client method that performs the actual HTTP GET request to Skolverket's syllabus API to retrieve curriculum versions.async getCurriculumVersions(code: string): Promise<VersionsResponse> { return this.get<VersionsResponse>(`/v1/curriculums/${code}/versions`); }