Skip to main content
Glama
gcorroto

SVN MCP Server

by gcorroto

svn_revert

Undo local changes to files in an SVN repository by reverting specified paths to their last committed state.

Instructions

Revertir cambios locales en archivos

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYesArchivo(s) o directorio(s) a revertir

Implementation Reference

  • Core handler implementing the 'svn revert' command execution via executeSvnCommand on normalized paths.
    async revert(paths: string | string[]): Promise<SvnResponse<string>> {
      try {
        const pathArray = Array.isArray(paths) ? paths : [paths];
        
        // Validar todas las rutas
        for (const path of pathArray) {
          if (!validatePath(path)) {
            throw new SvnError(`Invalid path: ${path}`);
          }
        }
    
        const args = ['revert'];
        
        // Añadir rutas normalizadas
        args.push(...pathArray.map(p => normalizePath(p)));
    
        const response = await executeSvnCommand(this.config, args);
    
        return {
          success: true,
          data: cleanOutput(response.data as string),
          command: response.command,
          workingDirectory: response.workingDirectory,
          executionTime: response.executionTime
        };
    
      } catch (error: any) {
        throw new SvnError(`Failed to revert files: ${error.message}`);
      }
    }
  • index.ts:484-509 (registration)
    MCP server tool registration for 'svn_revert', including input schema and wrapper handler that calls SvnService.revert and formats Markdown response.
    server.tool(
      "svn_revert",
      "Revertir cambios locales en archivos",
      {
        paths: z.union([z.string(), z.array(z.string())]).describe("Archivo(s) o directorio(s) a revertir")
      },
      async (args) => {
        try {
          const result = await getSvnService().revert(args.paths);
          const pathsArray = Array.isArray(args.paths) ? args.paths : [args.paths];
          
          const revertText = `↩️ **Cambios Revertidos**\n\n` +
            `**Archivos:** ${pathsArray.join(', ')}\n` +
            `**Comando:** ${result.command}\n` +
            `**Tiempo de Ejecución:** ${formatDuration(result.executionTime || 0)}\n\n` +
            `**Resultado:**\n\`\`\`\n${result.data}\n\`\`\``;
    
          return {
            content: [{ type: "text", text: revertText }],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `❌ **Error:** ${error.message}` }],
          };
        }
      }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool reverts local changes but doesn't clarify whether this is destructive (permanently discarding uncommitted work), requires authentication, has side effects on the working copy, or what happens on success/failure. This leaves significant gaps for a mutation tool.

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 in Spanish that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded with the core functionality.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'revertir' entails behaviorally (e.g., does it restore to last committed state?), potential risks, or expected outcomes, leaving the agent with insufficient context for safe invocation.

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 schema description coverage is 100%, with the parameter 'paths' well-documented as 'Archivo(s) o directorio(s) a revertir'. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3 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 action ('Revertir cambios locales') and target ('en archivos'), providing a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from sibling tools like 'svn_cleanup' or 'svn_update' which might also affect local changes, missing full sibling differentiation.

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 'svn_cleanup' (which might handle local issues differently) or 'svn_update' (which might fetch remote changes). There's no mention of prerequisites, timing, or exclusions for usage.

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/gcorroto/mcp-svn'

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