Skip to main content
Glama

search_programs

Search Swedish high school programs and study paths to help students choose educational tracks, compare options, and explore specializations with official curriculum data.

Instructions

Sök efter gymnasieprogram och studievägar.

ANVÄNDNINGSFALL:

  • Studie- och yrkesvägledning

  • Hjälpa elever välja program

  • Jämföra olika studievägar

  • Utforska inriktningar och profiler

RETURNERAR: Lista över program med inriktningar, profiler och beskrivning.

EXEMPEL: För gymnasieprogram, använd schooltype="GY" och timespan="LATEST".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schooltypeNo
timespanNo
typeOfSyllabusNo
studyPathTypeNo

Implementation Reference

  • Main execution logic for the search_programs tool. Calls the syllabus API client and returns formatted JSON response with limited results.
    export async function searchPrograms(params: { schooltype?: string; timespan?: 'LATEST' | 'FUTURE' | 'EXPIRED' | 'MODIFIED'; date?: string; typeOfStudyPath?: string; limit?: number; }) { try { const result = await syllabusApi.searchPrograms(params); // Begränsa antal resultat för att undvika stora responses const maxResults = Math.min(params.limit || 100, 200); const limitedPrograms = result.programs.slice(0, maxResults); const hasMore = result.totalElements > maxResults; return { content: [ { type: 'text' as const, text: JSON.stringify({ totalElements: result.totalElements, returned: limitedPrograms.length, hasMore: hasMore, message: hasMore ? `Visar ${limitedPrograms.length} av ${result.totalElements} program. Öka limit-parametern för att se fler.` : undefined, programs: limitedPrograms.map(p => ({ code: p.code, name: p.name, schoolType: p.schoolType, studyPathType: p.studyPathType, version: p.version, orientations: p.orientations?.map(o => o.name), profiles: p.profiles?.map(pr => pr.name), description: p.description?.substring(0, 150) + (p.description && p.description.length > 150 ? '...' : '') })) }, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Fel vid sökning av program: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
  • Input schema using Zod for validating parameters to the searchPrograms tool.
    export const searchProgramsSchema = { schooltype: z.string().optional().describe('Skoltyp (t.ex. "GY" för gymnasium)'), timespan: z.enum(['LATEST', 'FUTURE', 'EXPIRED', 'MODIFIED']).default('LATEST').describe('Tidsperiod: LATEST (gällande), FUTURE (framtida), EXPIRED (utgångna), MODIFIED (ändrade)'), date: z.string().optional().describe('Datum i formatet YYYY-MM-DD för att hämta program som var giltiga vid det datumet'), typeOfStudyPath: z.string().optional().describe('Typ av studieväg (t.ex. "PROGRAM" för gymnasieprogram)'), limit: z.number().optional().default(100).describe('Max antal resultat att returnera (default: 100, max: 200)') };
  • Registration of the search_programs tool in the HTTP server's tools map, mapping the name to the imported handler function.
    get_course_details: getCourseDetails, get_course_versions: getCourseVersions, search_programs: searchPrograms, get_program_details: getProgramDetails,
  • Underlying API client method that performs the actual HTTP request to Skolverket's syllabus API for searching programs.
    async searchPrograms(params: ProgramSearchParams = {}): Promise<ProgramsResponse> { return this.get<ProgramsResponse>('/v1/programs', params);
  • Import of the searchPrograms handler function used for tool registration.
    import { searchPrograms, getProgramDetails, getProgramVersions } from './tools/syllabus/programs.js';

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/isakskogstad/skolverket-syllabus-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server