Skip to main content
Glama

get_municipality_group

Retrieve detailed information about a specific Swedish municipality group including all member municipalities for statistical analysis and comparisons of similar municipalities.

Instructions

Hämta detaljerad information om en specifik kommungrupp inklusive alla medlemskommuner. Användbar för att analysera grupper av liknande kommuner.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_idYesKommungrupp-ID

Implementation Reference

  • The main handler function that executes the tool logic: fetches municipality group details from Kolada API using group_id, handles not found errors, logs execution.
    handler: async (args: z.infer<typeof getMunicipalityGroupSchema>): Promise<ToolResult> => { const startTime = Date.now(); const { group_id } = args; logger.toolCall('get_municipality_group', { group_id }); try { const response = await koladaClient.request<MunicipalityGroup>(`/municipality_groups/${group_id}`); if (response.values.length === 0) { logger.toolResult('get_municipality_group', false, Date.now() - startTime); return { content: [ { type: 'text', text: JSON.stringify({ error: 'NOT_FOUND', message: `Kommungrupp med ID "${group_id}" hittades inte`, suggestion: 'Använd get_municipality_groups för att hitta giltiga grupp-ID:n', }), }, ], isError: true, }; } logger.toolResult('get_municipality_group', true, Date.now() - startTime); return { content: [ { type: 'text', text: JSON.stringify(response.values[0], null, 2), }, ], }; } catch (error) { logger.toolResult('get_municipality_group', false, Date.now() - startTime); throw error; }
  • Zod input schema validating the 'group_id' parameter.
    const getMunicipalityGroupSchema = z.object({ group_id: z.string().describe('Kommungrupp-ID'), });
  • Registration of municipalityTools (containing get_municipality_group) into the central allTools object used by MCP server for tool listing and calling.
    export const allTools = { ...kpiTools, ...municipalityTools, ...ouTools, ...dataTools, ...analysisTools, };
  • Import of municipalityTools module containing the tool definition.
    import { municipalityTools } from '../tools/municipality-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