Skip to main content
Glama

get_study_path_codes

Retrieve Swedish upper secondary school program codes to identify educational pathways, filter by school type or program category, and access official study path identifiers for educational planning and data analysis.

Instructions

Hämta studievägskodar (programkoder).

ANVÄNDNINGSFALL:

  • Lista alla gymnasieprogram

  • Hitta programkoder

  • Filtrera efter typ

RETURNERAR: Lista över studievägar med koder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schooltypeNo
timespanNo
studyPathTypeNo

Implementation Reference

  • The handler function that implements the core logic of the 'get_study_path_codes' tool. It calls the syllabus API, formats the response as JSON, and handles errors.
    export async function getStudyPathCodes(params: { schooltype?: string; timespan?: 'LATEST' | 'FUTURE' | 'EXPIRED' | 'MODIFIED'; date?: string; typeOfStudyPath?: string; typeOfProgram?: string; }) { try { const codes = await syllabusApi.getStudyPathCodes(params); return { content: [ { type: 'text' as const, text: JSON.stringify({ studyPathCodes: codes, total: codes.length, filters: { schooltype: params.schooltype, timespan: params.timespan, date: params.date, typeOfStudyPath: params.typeOfStudyPath, typeOfProgram: params.typeOfProgram } }, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Fel vid hämtning av studievägskodar: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
  • Input schema using Zod for validating parameters to the getStudyPathCodes tool.
    export const getStudyPathCodesSchema = { schooltype: z.string().optional().describe('Filtrera på skoltyp (t.ex. "GY" för gymnasium)'), timespan: z.enum(['LATEST', 'FUTURE', 'EXPIRED', 'MODIFIED']).optional().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 studievägar som var giltiga vid det datumet'), typeOfStudyPath: z.string().optional().describe('Typ av studieväg (t.ex. "PROGRAM" för gymnasieprogram)'), typeOfProgram: z.string().optional().describe('Typ av program (t.ex. "HÖGSKOLEFÖRBEREDANDE", "YRKES")') };
  • Registration of the tool 'get_study_path_codes' mapping to the getStudyPathCodes handler function in the tools registry.
    get_study_path_codes: getStudyPathCodes,
  • Import statement bringing in the getStudyPathCodes function for tool registration.
    import { getSchoolTypes, getTypesOfSyllabus, getSubjectAndCourseCodes, getStudyPathCodes, getApiInfo } from './tools/syllabus/valuestore.js';
  • Underlying API client method called by the tool handler to fetch study path codes from Skolverket's API with caching.
    async getStudyPathCodes(params: StudyPathSearchParams = {}): Promise<StudyPathCode[]> { const response = await this.getCached<{ studyPaths: StudyPathCode[] }>( '/v1/valuestore/studypathcodes', params, 86400000 // 24 timmar cache ); return response.studyPaths || []; }

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