Skip to main content
Glama
mmntm

Weblate MCP Server

by mmntm

listRecentChanges

Track and review translation modifications across all Weblate projects. Filter changes by user or timeframe to monitor activity and maintain translation quality.

Instructions

List recent changes across all projects in Weblate

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of changes to return (default: 20)
userNoFilter by specific user
timestampAfterNoShow changes after this timestamp (ISO format)
timestampBeforeNoShow changes before this timestamp (ISO format)

Implementation Reference

  • The primary handler function for the 'listRecentChanges' MCP tool. It invokes the WeblateApiService, handles empty results and errors, formats the changes using helper methods, and returns a structured MCP content response.
    async listRecentChanges({
      limit = 20,
      user,
      timestampAfter,
      timestampBefore,
    }: {
      limit?: number;
      user?: string;
      timestampAfter?: string;
      timestampBefore?: string;
    }) {
      try {
        const result = await this.weblateApiService.listRecentChanges(
          limit,
          user,
          timestampAfter,
          timestampBefore,
        );
    
        if (result.results.length === 0) {
          return {
            content: [
              {
                type: 'text',
                text: 'No recent changes found.',
              },
            ],
          };
        }
    
        const changesList = result.results
          .slice(0, limit)
          .map(change => this.formatChangeResult(change))
          .join('\n\n---\n\n');
    
        return {
          content: [
            {
              type: 'text',
              text: `Found ${result.count} recent changes (showing ${Math.min(limit, result.results.length)}):\n\n${changesList}`,
            },
          ],
        };
      } catch (error) {
        this.logger.error('Failed to list recent changes', error);
        return {
          content: [
            {
              type: 'text',
              text: `Error listing recent changes: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Zod schema defining the input parameters for the listRecentChanges tool: limit, user, timestampAfter, timestampBefore.
    parameters: z.object({
      limit: z.number().optional().describe('Number of changes to return (default: 20)').default(20),
      user: z.string().optional().describe('Filter by specific user'),
      timestampAfter: z.string().optional().describe('Show changes after this timestamp (ISO format)'),
      timestampBefore: z.string().optional().describe('Show changes before this timestamp (ISO format)'),
    }),
  • @Tool decorator that registers the listRecentChanges function as an MCP tool, specifying name, description, and input schema.
    @Tool({
      name: 'listRecentChanges',
      description: 'List recent changes across all projects in Weblate',
      parameters: z.object({
        limit: z.number().optional().describe('Number of changes to return (default: 20)').default(20),
        user: z.string().optional().describe('Filter by specific user'),
        timestampAfter: z.string().optional().describe('Show changes after this timestamp (ISO format)'),
        timestampBefore: z.string().optional().describe('Show changes before this timestamp (ISO format)'),
      }),
    })
  • Helper method to format a single Change object into a human-readable markdown string used in the tool response.
    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}`;
    }
  • Helper method that maps numeric action codes from Weblate changes to descriptive strings for display in tool output.
    private getActionDescription(action: number): string {
      const actionMap: Record<number, string> = {
        0: 'Resource updated',
        1: 'Translation completed',
        2: 'Translation changed',
        3: 'Comment added',
        4: 'Suggestion added',
        5: 'Translation added',
        6: 'Automatically translated',
        7: 'Suggestion accepted',
        8: 'Translation reverted',
        9: 'Translation uploaded',
        13: 'Source string added',
        14: 'Component locked',
        15: 'Component unlocked',
        17: 'Changes committed',
        18: 'Changes pushed',
        19: 'Repository reset',
        20: 'Repository merged',
        21: 'Repository rebased',
        22: 'Repository merge failed',
        23: 'Repository rebase failed',
        24: 'Parsing failed',
        25: 'Translation removed',
        26: 'Suggestion removed',
        27: 'Translation replaced',
        28: 'Repository push failed',
        29: 'Suggestion removed during clean-up',
        30: 'Source string changed',
        31: 'String added',
        32: 'Bulk status changed',
        33: 'Visibility changed',
        34: 'User added',
        35: 'User removed',
        36: 'Translation approved',
        37: 'Marked for edit',
        38: 'Component removed',
        39: 'Project removed',
        41: 'Project renamed',
        42: 'Component renamed',
        43: 'Moved component',
        45: 'Contributor joined',
        46: 'Announcement posted',
        47: 'Alert triggered',
        48: 'Language added',
        49: 'Language requested',
        50: 'Project created',
        51: 'Component created',
        52: 'User invited',
      };
      
      return actionMap[action] || `Unknown action (${action})`;
    }
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 states 'List recent changes' but doesn't disclose behavioral traits like pagination, rate limits, authentication requirements, or what constitutes a 'change' (e.g., edits, additions). This leaves significant gaps for a tool with 4 parameters and no output schema.

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. There is no wasted verbiage or redundancy, making it highly concise and well-structured for quick understanding.

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, no output schema, and 4 parameters, the description is incomplete. It lacks context on authentication, rate limits, return format (e.g., list of change objects), or error handling. For a tool that likely returns complex data, this minimal description leaves the agent under-informed.

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%, so the schema fully documents all 4 parameters. The description adds no additional parameter semantics beyond implying a default scope ('across all projects'), which is already suggested by the tool name. This meets the baseline for high schema coverage.

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 'List' and the resource 'recent changes across all projects in Weblate', which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'getChangesByUser' or 'getProjectChanges', which appear to be more targeted versions of similar functionality.

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. With siblings like 'getChangesByUser' (user-specific) and 'getProjectChanges' (project-specific), the agent must infer that this tool is for cross-project changes without explicit comparison or exclusion statements.

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