siigo_get_cities
Retrieve the complete catalog of Colombian cities available in the Siigo accounting system for accurate location data in financial documents and client records.
Instructions
Get cities catalog
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1111-1114 (handler)MCP tool handler function that executes the tool logic by calling SiigoClient.getCities() and formatting the response as MCP content.private async handleGetCities(args: any) { const result = await this.siigoClient.getCities(); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/siigo-client.ts:242-244 (handler)Core tool implementation in SiigoClient: performs authenticated GET request to Siigo API endpoint '/v1/cities'.async getCities(): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('GET', '/v1/cities'); }
- src/index.ts:717-721 (registration)Tool registration in getTools() method, including name, description, and input schema (no parameters required).{ name: 'siigo_get_cities', description: 'Get cities catalog', inputSchema: { type: 'object', properties: {} }, },
- src/index.ts:163-164 (handler)Dispatch case in the main CallToolRequestSchema handler switch statement that routes the tool call to handleGetCities.case 'siigo_get_cities': return await this.handleGetCities(args);
- src/siigo-client.ts:41-59 (helper)Shared helper method used by getCities() to handle authentication, make Axios request to Siigo API, and process response or error.private async makeRequest<T>(method: string, endpoint: string, data?: any, params?: any): Promise<SiigoApiResponse<T>> { await this.authenticate(); try { const response: AxiosResponse<SiigoApiResponse<T>> = await this.httpClient.request({ method, url: endpoint, data, params, }); return response.data; } catch (error: any) { if (error.response?.data) { return error.response.data; } throw new Error(`API request failed: ${error.message}`); } }