Skip to main content
Glama
mmntm

Weblate MCP Server

by mmntm

getChangesByUser

Retrieve recent translation changes made by a specific user in Weblate projects to track contributions and review modifications.

Instructions

Get recent changes by a specific user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userYesUsername to filter by
limitNoNumber of changes to return (default: 20)

Implementation Reference

  • The primary handler for the 'getChangesByUser' tool. This method is decorated with @Tool, defines its schema, fetches changes using the WeblateApiService, formats the results with helper functions, and returns a structured content response or handles errors.
    @Tool({
      name: 'getChangesByUser',
      description: 'Get recent changes by a specific user',
      parameters: z.object({
        user: z.string().describe('Username to filter by'),
        limit: z.number().optional().describe('Number of changes to return (default: 20)').default(20),
      }),
    })
    async getChangesByUser({
      user,
      limit = 20,
    }: {
      user: string;
      limit?: number;
    }) {
      try {
        const result = await this.weblateApiService.getChangesByUser(user, limit);
    
        if (result.results.length === 0) {
          return {
            content: [
              {
                type: 'text',
                text: `No changes found for user "${user}".`,
              },
            ],
          };
        }
    
        const changesList = result.results
          .slice(0, limit)
          .map(change => this.formatChangeResult(change))
          .join('\n\n---\n\n');
    
        return {
          content: [
            {
              type: 'text',
              text: `Recent changes by user "${user}" (${result.count} total):\n\n${changesList}`,
            },
          ],
        };
      } catch (error) {
        this.logger.error(`Failed to get changes by user ${user}`, error);
        return {
          content: [
            {
              type: 'text',
              text: `Error getting changes by user "${user}": ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Registration of the WeblateChangesTool class in the AppModule providers array, which enables automatic registration of all @Tool methods including getChangesByUser with the MCP server.
    WeblateChangesTool,
  • The getChangesByUser tool is explicitly listed in the MCP server instructions string provided to the McpModule.
    - getChangesByUser: Get recent changes by a specific user
  • Helper method used by the handler to format each change into a readable string with action, user, time, and target details.
    private formatChangeResult(change: Change): string {
      const timestamp = change.timestamp ? new Date(change.timestamp).toLocaleString() : 'Unknown';
      const actionDescription = this.getActionDescription(change.action || 0);
      const user = change.user || 'Unknown user';
      const target = change.target || 'N/A';
      
      return `**${actionDescription}**\n**User:** ${user}\n**Time:** ${timestamp}\n**Target:** ${target}`;
    }
  • Underlying service helper that implements getChangesByUser by calling listRecentChanges with user filter, ultimately querying the Weblate API.
    async getChangesByUser(
      user: string,
      limit: number = 50
    ): Promise<{ results: Change[]; count: number; next?: string; previous?: string }> {
      try {
        return this.listRecentChanges(limit, user);
      } catch (error) {
        this.logger.error(`Failed to get changes by user ${user}`, error);
        throw new Error(`Failed to get changes by user: ${error.message}`);
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'recent changes' but doesn't define what 'recent' means (e.g., time range, recency criteria). It also lacks details on permissions, rate limits, output format, or pagination behavior. For a read operation with no annotation coverage, this leaves significant behavioral gaps.

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 with zero waste. It's front-loaded with the core purpose ('Get recent changes by a specific user'), and every word earns its place without redundancy or fluff.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what 'changes' entail (e.g., edit history, audit logs), the return format, or error handling. For a tool with 2 parameters and sibling complexity, more context is needed to guide the agent effectively.

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?

Schema description coverage is 100%, with clear parameter documentation in the schema. The description adds no additional meaning beyond implying user-based filtering, which is already covered by the schema's 'user' parameter description. Baseline 3 is appropriate as 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 verb ('Get') and resource ('recent changes'), specifying it's filtered 'by a specific user'. It distinguishes from siblings like 'listRecentChanges' (no user filter) and 'getProjectChanges' (project-filtered), though not explicitly named. However, it doesn't fully differentiate from all siblings like 'getComponentChanges' or 'getUserStatistics', keeping it at 4 rather than 5.

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. It doesn't mention siblings like 'listRecentChanges' (for all changes) or 'getProjectChanges' (for project-specific changes), nor does it specify prerequisites or exclusions. The agent must infer usage from the name and parameters alone.

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