get_country_translations
Retrieve name translations for a country by its UUID, optionally filtered by preferred languages using BCP 47 tags.
Instructions
Get name translations for a country by its UUID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Country UUID | |
| preferredLanguages | No | Comma-separated BCP 47 language tags (e.g. "fr,es,en") |
Implementation Reference
- src/server.ts:143-154 (registration)Registration of the 'get_country_translations' tool via server.tool(), including its description and schema definition.
server.tool( 'get_country_translations', 'Get name translations for a country by its UUID.', { id: z.string().describe('Country UUID'), preferredLanguages: z.string().optional().describe('Comma-separated BCP 47 language tags (e.g. "fr,es,en")'), }, async ({ id, preferredLanguages }) => { const result = await client.countries.translations(id, { preferredLanguages }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }, ); - src/server.ts:146-149 (schema)Zod schema for the tool's input: required 'id' (string) and optional 'preferredLanguages' (string).
{ id: z.string().describe('Country UUID'), preferredLanguages: z.string().optional().describe('Comma-separated BCP 47 language tags (e.g. "fr,es,en")'), }, - src/server.ts:150-153 (handler)Handler function that calls client.countries.translations(id, { preferredLanguages }) and returns the result as JSON text content.
async ({ id, preferredLanguages }) => { const result = await client.countries.translations(id, { preferredLanguages }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; },