list_available_languages
Retrieve all supported language codes from POEditor's translation management system to identify available options for multilingual content projects.
Instructions
List all available languages that POEditor supports (not project-specific, but all possible language codes).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:301-304 (handler)Inline handler function for the 'list_available_languages' tool. It calls the POEditor 'languages/available' API endpoint and returns the list of available languages as a formatted JSON text block.async () => { const res = await poeditor("languages/available", {}); return { content: [{ type: "text", text: JSON.stringify(res.result ?? {}, null, 2) }] }; }
- src/server.ts:297-305 (registration)Registration of the 'list_available_languages' tool using server.tool(). Includes name, description, empty input schema, and inline handler.server.tool( "list_available_languages", "List all available languages that POEditor supports (not project-specific, but all possible language codes).", {}, async () => { const res = await poeditor("languages/available", {}); return { content: [{ type: "text", text: JSON.stringify(res.result ?? {}, null, 2) }] }; } );
- src/server.ts:300-300 (schema)Empty Zod schema object indicating the tool takes no input parameters.{},
- src/server.ts:19-38 (helper)Helper function 'poeditor' used by the tool handler to make authenticated API requests to POEditor.export async function poeditor(endpoint: string, form: Record<string, string>) { const body = new URLSearchParams({ api_token: API_TOKEN!, ...form }); const { body: resBody } = await request(`${API_BASE}/${endpoint}`, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: body.toString() }); const text = await resBody.text(); let json: any; try { json = JSON.parse(text); } catch (e) { throw new Error(`POEditor: invalid JSON response: ${text}`); } const status = json?.response?.status; if (status !== "success") { const code = json?.response?.code; const message = json?.response?.message || "Unknown POEditor error"; throw new Error(`POEditor API error ${code ?? ""}: ${message}`); } return json; }