Skip to main content
Glama

list_operating_areas

Explore available Swedish public sector data categories by listing all operating areas (like Education, Healthcare) with their KPI counts to identify relevant datasets for analysis.

Instructions

Lista alla verksamhetsområden (t.ex. Utbildning, Vård och omsorg) med antal KPIs per område. Ger överblick över vilka typer av data som finns tillgänglig.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Full tool definition including the handler function that lists all operating areas by counting KPIs from the cached catalog, sorting by count, and returning a structured JSON response.
    list_operating_areas: { description: 'Lista alla verksamhetsområden (t.ex. Utbildning, Vård och omsorg) med antal KPIs per område. Ger överblick över vilka typer av data som finns tillgänglig.', inputSchema: listOperatingAreasSchema, annotations: READ_ONLY_ANNOTATIONS, handler: async (): Promise<ToolResult> => { const startTime = Date.now(); logger.toolCall('list_operating_areas', {}); try { // Use cached KPI catalog const kpis = await dataCache.getOrFetch( 'kpi-catalog-full', () => koladaClient.fetchAllData<KPI>('/kpi'), 86400000 ); // Count KPIs per operating area const areaCounts: Record<string, number> = {}; for (const kpi of kpis) { const area = kpi.operating_area || 'Övrigt'; areaCounts[area] = (areaCounts[area] || 0) + 1; } // Sort by count descending const sortedAreas = Object.entries(areaCounts) .sort((a, b) => b[1] - a[1]) .map(([name, count]) => ({ name, kpi_count: count })); logger.toolResult('list_operating_areas', true, Date.now() - startTime); return { content: [ { type: 'text', text: JSON.stringify( { total_kpis: kpis.length, operating_areas_count: sortedAreas.length, operating_areas: sortedAreas, usage_tip: 'Använd get_kpis_by_operating_area med ett områdesnamn för att se KPIs inom det området.', }, null, 2 ), }, ], }; } catch (error) { logger.toolResult('list_operating_areas', false, Date.now() - startTime); throw error; } }, },
  • Input schema for the list_operating_areas tool, which takes no parameters.
    const listOperatingAreasSchema = z.object({});
  • Registration of all tools by spreading analysisTools (containing list_operating_areas) into the central allTools object used by MCP handlers.
    export const allTools = { ...kpiTools, ...municipalityTools, ...ouTools, ...dataTools, ...analysisTools, };
  • Import of analysisTools module containing the list_operating_areas tool.
    import { analysisTools } from '../tools/analysis-tools.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/Kolada-MCP'

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