Skip to main content
Glama
gcorroto

SVN MCP Server

by gcorroto

svn_cleanup

Clean up interrupted operations in a Subversion working copy to resolve conflicts and restore functionality.

Instructions

Limpiar working copy de operaciones interrumpidas

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoRuta específica a limpiar

Implementation Reference

  • Core implementation of the svn_cleanup tool logic in SvnService class. Validates optional path, constructs 'svn cleanup' command arguments, executes the command using executeSvnCommand utility, processes output, and returns structured response.
    async cleanup(path?: string): Promise<SvnResponse<string>> {
      try {
        const args = ['cleanup'];
        
        if (path) {
          if (!validatePath(path)) {
            throw new SvnError(`Invalid path: ${path}`);
          }
          args.push(normalizePath(path));
        }
    
        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 cleanup: ${error.message}`);
      }
    }
  • index.ts:513-538 (registration)
    MCP server registration of the 'svn_cleanup' tool, including Zod input schema for optional 'path' parameter, thin handler wrapper that delegates to SvnService.cleanup(), formats the response as formatted Markdown text, and handles errors.
    server.tool(
      "svn_cleanup",
      "Limpiar working copy de operaciones interrumpidas",
      {
        path: z.string().optional().describe("Ruta específica a limpiar")
      },
      async (args) => {
        try {
          const result = await getSvnService().cleanup(args.path);
          
          const cleanupText = `🧹 **Cleanup Completado**\n\n` +
            `**Ruta:** ${args.path || 'Directorio actual'}\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: cleanupText }],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `❌ **Error:** ${error.message}` }],
          };
        }
      }
    );
  • Zod input schema definition for the svn_cleanup tool: optional string 'path' parameter with description.
    {
      path: z.string().optional().describe("Ruta específica a limpiar")
    },

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