Skip to main content
Glama

svn_revert

Revert local changes to files or directories in a Subversion (SVN) repository by specifying the paths to undo modifications and restore previous versions.

Instructions

Revertir cambios locales en archivos

Input Schema

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

Implementation Reference

  • Core handler implementation in SvnService.revert(). Validates paths, constructs 'svn revert [paths]' command arguments, executes via executeSvnCommand, cleans output, and returns structured response.
    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-510 (registration)
    MCP tool registration for 'svn_revert'. Includes description, input schema validation with Zod, and thin async 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}` }], }; } } );
  • Zod input schema defining the 'paths' parameter as string or array of strings for files/directories to revert.
    { paths: z.union([z.string(), z.array(z.string())]).describe("Archivo(s) o directorio(s) a revertir") },

Other Tools

Related 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