Skip to main content
Glama

get_school_types

Retrieve all available school types from Skolverket's official classification system to filter educational data and understand Swedish school categories.

Instructions

Hämta lista över alla skoltyper.

ANVÄNDNINGSFALL:

  • Se tillgängliga skolformer

  • Förstå Skolverkets kategorisering

  • Filtrera data efter skoltyp

RETURNERAR: Lista över skoltyper med koder och namn.

VÄRDEN: GR (Grundskola), GY (Gymnasium), VUX (Vuxenutbildning), GRSÄR (Grundsärskola), GYSÄR (Gymnasiesärskola).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeExpiredNo

Implementation Reference

  • Main handler function for the 'get_school_types' tool. Fetches active school types and optionally expired ones from the syllabus API, formats as JSON text response, handles errors.
    export async function getSchoolTypes(params: { includeExpired?: boolean; }) { try { const activeTypes = await syllabusApi.getSchoolTypes(); let expiredTypes: any[] = []; if (params.includeExpired) { expiredTypes = await syllabusApi.getExpiredSchoolTypes(); } return { content: [ { type: 'text' as const, text: JSON.stringify({ activeSchoolTypes: activeTypes, expiredSchoolTypes: params.includeExpired ? expiredTypes : undefined, total: activeTypes.length + expiredTypes.length }, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Fel vid hämtning av skoltyper: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
  • Input schema for getSchoolTypes using Zod validation for optional includeExpired boolean parameter.
    export const getSchoolTypesSchema = { includeExpired: z.boolean().optional().default(false).describe('Inkludera utgångna skoltyper') };
  • Tool registration in the HTTP server's tools registry, mapping 'get_school_types' to the getSchoolTypes handler function.
    get_school_types: getSchoolTypes,
  • Helper method in SyllabusApiClient that fetches active school types from Skolverket API with 24-hour caching.
    async getSchoolTypes(): Promise<SchoolType[]> { const response = await this.getCached<{ schoolTypes: SchoolType[] }>( '/v1/valuestore/schooltypes', undefined, 86400000 // 24 timmar cache ); return response.schoolTypes || []; }

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