Skip to main content
Glama
mmntm

Weblate MCP Server

by mmntm

getProjectDashboard

Retrieve a comprehensive dashboard with component statistics for a Weblate translation project to monitor progress and manage localization workflows.

Instructions

Get a comprehensive dashboard overview for a project with all component statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectSlugYesThe slug of the project

Implementation Reference

  • Tool registration via @Tool decorator, including name, description, and Zod input schema for parameters.
    @Tool({
      name: 'getProjectDashboard',
      description: 'Get a comprehensive dashboard overview for a project with all component statistics',
      parameters: z.object({
        projectSlug: z.string().describe('The slug of the project'),
      }),
    })
  • The main handler function that invokes the statistics service, formats the dashboard output, and handles errors.
    async getProjectDashboard({ projectSlug }: { projectSlug: string }) {
      try {
        const dashboard = await this.statisticsService.getProjectDashboard(projectSlug);
    
        return {
          content: [
            {
              type: 'text',
              text: this.formatProjectDashboard(projectSlug, dashboard),
            },
          ],
        };
      } catch (error) {
        this.logger.error(`Failed to get project dashboard for ${projectSlug}`, error);
        return {
          content: [
            {
              type: 'text',
              text: `Error getting project dashboard: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
  • Private helper method to format the raw dashboard data into a comprehensive Markdown string with project stats and component breakdowns.
      private formatProjectDashboard(projectSlug: string, dashboard: any): string {
        const project = dashboard.project;
        const components = dashboard.components || [];
    
        let result = this.formatProjectStatistics(projectSlug, project);
        result += '\n\n## 📋 Component Breakdown\n\n';
    
        components.forEach((comp: any, index: number) => {
          if (comp.statistics) {
            const stats = comp.statistics;
            const formatPercent = (value: any) => {
              return typeof value === 'number' ? `${value.toFixed(1)}%` : 'N/A';
            };
    
            result += `**${index + 1}. ${comp.component}** (${comp.slug})
    - 🎯 Progress: ${formatPercent(stats.translated_percent)}
    - ✅ Approved: ${formatPercent(stats.approved_percent)}
    - 📝 Total Strings: ${stats.total || 'N/A'}
    
    `;
          } else {
            result += `**${index + 1}. ${comp.component}** (${comp.slug})
    - ❌ Error: ${comp.error || 'Unable to load statistics'}
    
    `;
          }
        });
    
        return result;
      }
  • Core service method that implements the dashboard logic: fetches project statistics, lists components, retrieves stats for each component, and aggregates results.
    async getProjectDashboard(projectSlug: string) {
      try {
        // Get project info and components
        const [projectStats, components] = await Promise.all([
          this.getProjectStatistics(projectSlug),
          this.componentsService.listComponents(projectSlug),
        ]);
    
        // Get statistics for each component
        const componentStats = await Promise.all(
          components.map(async (component) => {
            try {
              const stats = await this.getComponentStatistics(projectSlug, component.slug);
              return {
                component: component.name,
                slug: component.slug,
                statistics: stats,
              };
            } catch (error) {
              this.logger.warn(`Failed to get stats for component ${component.slug}`, error);
              return {
                component: component.name,
                slug: component.slug,
                statistics: null,
                error: error.message,
              };
            }
          }),
        );
    
        return {
          project: projectStats,
          components: componentStats,
        };
      } catch (error) {
        this.logger.error(`Failed to get project dashboard for ${projectSlug}`, error);
        throw error;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves a dashboard overview, implying a read-only operation, but fails to mention critical details like authentication needs, rate limits, response format, or whether it's a safe operation. This is a significant gap for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without any wasted words. It appropriately sized for the tool's complexity, earning its place by clearly stating what the tool does.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It covers the basic purpose but omits essential behavioral context (e.g., response format, safety, authentication) and usage guidelines, making it inadequate for a tool that likely returns complex dashboard data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'projectSlug' documented as 'The slug of the project.' The description adds no additional meaning beyond this, such as format examples or constraints, so it meets the baseline of 3 where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with the verb 'Get' and resource 'comprehensive dashboard overview for a project with all component statistics.' It distinguishes from siblings like getProjectStatistics or getComponentStatistics by emphasizing a comprehensive dashboard view, though it could be more explicit about the difference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like getProjectStatistics or getComponentStatistics. It lacks explicit when/when-not instructions or named alternatives, leaving usage context implied at best.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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