listLanguages
Retrieve a list of supported languages for a specific project in Weblate MCP Server, using the project's unique slug to identify it.
Instructions
List languages available in a specific project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectSlug | Yes | The slug of the project |
Implementation Reference
- src/tools/languages.tool.ts:19-48 (handler)The handler function for the 'listLanguages' MCP tool. It calls the Weblate API service to fetch languages for a project and formats them into a markdown list, handling errors appropriately.async listLanguages({ projectSlug }: { projectSlug: string }) { try { const languages = await this.weblateApiService.listLanguages(projectSlug); return { content: [ { type: 'text', text: `Languages in project "${projectSlug}":\n\n${languages .map( (l) => `- **${l.name}** (${l.code})`, ) .join('\n')}`, }, ], }; } catch (error) { this.logger.error(`Failed to list languages for ${projectSlug}`, error); return { content: [ { type: 'text', text: `Error listing languages for project "${projectSlug}": ${error.message}`, }, ], isError: true, }; } }
- src/tools/languages.tool.ts:12-18 (schema)The @Tool decorator defines the schema, name, description, and input parameters (projectSlug) using Zod validation for the listLanguages tool.@Tool({ name: 'listLanguages', description: 'List languages available in a specific project', parameters: z.object({ projectSlug: z.string().describe('The slug of the project'), }), })
- src/app.module.ts:76-76 (registration)The WeblateLanguagesTool class is registered as a provider in the AppModule, making the listLanguages tool available in the MCP server.WeblateLanguagesTool,