Skip to main content
Glama

get_organizational_unit

Retrieve detailed information about a specific organizational unit using its ID to access Swedish municipal and regional data for analysis and comparisons.

Instructions

Hämta detaljerad information om en specifik organisationsenhet via dess ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ou_idYesOrganisationsenhet-ID

Implementation Reference

  • Full tool definition including the handler function that executes the core logic: fetches OU details from Kolada API via koladaClient.request(`/ou/${ou_id}`), handles not found cases, logs execution, and returns JSON-formatted response or error.
    get_organizational_unit: { description: 'Hämta detaljerad information om en specifik organisationsenhet via dess ID.', inputSchema: getOuSchema, annotations: READ_ONLY_ANNOTATIONS, handler: async (args: z.infer<typeof getOuSchema>): Promise<ToolResult> => { const startTime = Date.now(); const { ou_id } = args; logger.toolCall('get_organizational_unit', { ou_id }); try { const response = await koladaClient.request<OrganizationalUnit>(`/ou/${ou_id}`); if (response.values.length === 0) { logger.toolResult('get_organizational_unit', false, Date.now() - startTime); return { content: [ { type: 'text', text: JSON.stringify({ error: 'NOT_FOUND', message: `Organisationsenhet med ID "${ou_id}" hittades inte`, suggestion: 'Använd search_organizational_units för att hitta giltiga OU-ID:n', }), }, ], isError: true, }; } logger.toolResult('get_organizational_unit', true, Date.now() - startTime); return { content: [ { type: 'text', text: JSON.stringify(response.values[0], null, 2), }, ], }; } catch (error) { logger.toolResult('get_organizational_unit', false, Date.now() - startTime); throw error; } },
  • Zod input schema for validating the 'ou_id' parameter required by the tool.
    const getOuSchema = z.object({ ou_id: z.string().describe('Organisationsenhet-ID'), });
  • Registration of ouTools (containing get_organizational_unit) into the central allTools object used by MCP server handlers for listing and calling tools.
    export const allTools = { ...kpiTools, ...municipalityTools, ...ouTools, ...dataTools, ...analysisTools, };

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