Skip to main content
Glama

search_school_units

Search for Swedish school units using filters to find schools by name, status (active, closed, dormant), and build school registries for planning and analysis purposes.

Instructions

Sök efter skolenheter med filter.

ANVÄNDNINGSFALL:

  • Hitta skolor i ett område

  • Filtrera efter status (aktiva, nedlagda, vilande)

  • Bygga skolregister

  • Planering och analys

RETURNERAR: Lista över skolenheter med kod, namn och status.

EXEMPEL: Sök aktiva skolor med status="AKTIV".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNo
statusNo
limitNo

Implementation Reference

  • Main handler function executing the tool logic: searches school units via API, limits results, formats JSON response with error handling.
    export async function searchSchoolUnits(params: { name?: string; status?: 'AKTIV' | 'UPPHORT' | 'VILANDE'; limit?: number; }) { try { const units = await schoolUnitsApi.searchSchoolUnits({ name: params.name, status: params.status }); // Begränsa antal resultat const limitedUnits = params.limit ? units.slice(0, params.limit) : units.slice(0, 50); return { content: [ { type: 'text' as const, text: JSON.stringify({ totalFound: units.length, showing: limitedUnits.length, schoolUnits: limitedUnits }, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Fel vid sökning av skolenheter: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
  • Zod schema defining input parameters for the search_school_units tool.
    export const searchSchoolUnitsSchema = { name: z.string().optional().describe('Sök efter skolenhet med namn (delmatchning)'), status: z.enum(['AKTIV', 'UPPHORT', 'VILANDE']).optional().describe('Filtrera på status (AKTIV, UPPHORT, VILANDE)'), limit: z.number().optional().default(50).describe('Maximalt antal resultat att returnera') };
  • Import statement bringing the searchSchoolUnits handler into the HTTP server module.
    import { searchSchoolUnits, getSchoolUnitDetails, getSchoolUnitsByStatus, searchSchoolUnitsByName } from './tools/school-units/search.js';
  • Registration of the tool under the name 'search_school_units' in the tools registry object used by the server.
    search_school_units: searchSchoolUnits,

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