Skip to main content
Glama
mmntm

Weblate MCP Server

by mmntm

listProjects

Retrieve all available translation projects in the Weblate MCP Server to manage, access, and organize multilingual content efficiently.

Instructions

List all available Weblate projects

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for listProjects: decorated function that fetches projects from WeblateApiService and returns formatted text content or error.
    @Tool({ name: 'listProjects', description: 'List all available Weblate projects', parameters: z.object({}), }) async listProjects() { try { const projects = await this.weblateApiService.listProjects(); return { content: [ { type: 'text', text: `Found ${projects.length} projects:\n\n${projects .map((p) => `- **${p.name}** (${p.slug})\n URL: ${p.web_url}`) .join('\n\n')}`, }, ], }; } catch (error) { this.logger.error('Failed to list projects', error); return { content: [ { type: 'text', text: `Error listing projects: ${error.message}`, }, ], isError: true, }; } }
  • Registration of WeblateProjectsTool in AppModule providers, making the tool available to McpModule.
    WeblateProjectsTool,
  • Helper service method implementing the core logic to list Weblate projects via API client.
    async listProjects(): Promise<Project[]> { try { const client = this.weblateClientService.getClient(); const response = await projectsList({ client }); // The generated client returns the response with data field const projects = response.data; // Check if response.data is an array directly (some APIs return array directly) if (Array.isArray(projects)) { return projects; } // Check if response.data.results exists (paginated response) if (projects && Array.isArray(projects.results)) { return projects.results; } return []; } catch (error) { this.logger.error('Failed to list projects', error); throw new Error(`Failed to list projects: ${error.message}`); } }
  • Zod schema for listProjects tool parameters: empty object (no parameters).
    parameters: z.object({}),
  • Proxy helper in WeblateApiService delegating to projectsService.listProjects().
    async listProjects(): Promise<Project[]> { return this.projectsService.listProjects(); }

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