Skip to main content
Glama
mmntm

Weblate MCP Server

by mmntm

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
NameRequiredDescriptionDefault
projectSlugYesThe slug of the project

Implementation Reference

  • 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, }; } }
  • 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'), }), })
  • The WeblateLanguagesTool class is registered as a provider in the AppModule, making the listLanguages tool available in the MCP server.
    WeblateLanguagesTool,

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mmntm/weblate-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server