get_country_regions
Retrieve all administrative regions of a country using its UUID. Input a country UUID to get a list of its regions.
Instructions
Get all administrative regions belonging to a country by its UUID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Country UUID |
Implementation Reference
- src/server.ts:156-164 (registration)Registration of the 'get_country_regions' tool using server.tool(). The handler calls client.countries.regions(id) and returns the result as formatted JSON text. Input schema expects a single 'id' (Country UUID) string.
server.tool( 'get_country_regions', 'Get all administrative regions belonging to a country by its UUID.', { id: z.string().describe('Country UUID') }, async ({ id }) => { const result = await client.countries.regions(id); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }, ); - src/server.ts:159-159 (schema)Input schema for 'get_country_regions': requires a string field 'id' described as 'Country UUID'. Uses Zod for validation.
{ id: z.string().describe('Country UUID') }, - src/server.ts:160-163 (handler)Handler function for 'get_country_regions'. It extracts 'id' from the input, calls client.countries.regions(id) to fetch administrative regions for the given country UUID, and returns the result as a JSON-formatted text content.
async ({ id }) => { const result = await client.countries.regions(id); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; },