get_program_versions
Retrieve version history for educational programs to track curriculum changes, compare program plans, and understand vocational training development.
Instructions
Hämta versionshistorik för ett program.
ANVÄNDNINGSFALL:
Spåra hur program förändrats
Jämföra gamla och nya programplaner
Förstå utveckling av yrkesutbildningar
RETURNERAR: Lista över alla versioner med datum.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Implementation Reference
- src/tools/syllabus/programs.ts:108-137 (handler)Main handler function that executes the tool: validates input implicitly via schema elsewhere, calls syllabusApi.getProgramVersions, formats response as JSON or error.export async function getProgramVersions(params: { code: string; }) { try { const versions = await syllabusApi.getProgramVersions(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 programversioner: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
- src/tools/syllabus/programs.ts:23-25 (schema)Zod schema defining the input parameters for the tool (requires 'code' string).export const getProgramVersionsSchema = { code: z.string().describe('Programkod att hämta versioner för') };
- src/http-server.ts:59-61 (registration)Registers the getProgramVersions function as the 'get_program_versions' tool in the central tools registry object.search_programs: searchPrograms, get_program_details: getProgramDetails, get_program_versions: getProgramVersions,
- src/http-server.ts:24-24 (registration)Imports the getProgramVersions handler function into the http-server for registration.import { searchPrograms, getProgramDetails, getProgramVersions } from './tools/syllabus/programs.js';
- src/api/syllabus-client.ts:89-90 (helper)API client helper method in SyllabusApiClient that makes the HTTP request to Skolverket's /v1/programs/{code}/versions endpoint.async getProgramVersions(code: string): Promise<VersionsResponse> { return this.get<VersionsResponse>(`/v1/programs/${code}/versions`);