Skip to main content
Glama

svn_add

Add files or directories to version control, optionally forcing addition, ignoring exclusion rules, creating parent directories, or applying auto-properties, using the SVN MCP Server.

Instructions

Añadir archivos al control de versiones

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
autoPropsNoAplicar auto-propiedades
forceNoForzar adición
noAutoPropsNoNo aplicar auto-propiedades
noIgnoreNoNo respetar reglas de ignore
parentsNoCrear directorios padre si es necesario
pathsYesArchivo(s) o directorio(s) a añadir

Implementation Reference

  • The core handler function `add` in SvnService class that builds the `svn add` command arguments based on options, validates paths, executes the command via `executeSvnCommand`, and returns the result.
    async add( paths: string | string[], options: SvnAddOptions = {} ): 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 = ['add']; if (options.force) { args.push('--force'); } if (options.noIgnore) { args.push('--no-ignore'); } if (options.autoProps) { args.push('--auto-props'); } if (options.noAutoProps) { args.push('--no-auto-props'); } if (options.parents) { args.push('--parents'); } // 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 add files: ${error.message}`); } }
  • TypeScript interface defining the input options for the svn_add tool, used by the handler.
    export interface SvnAddOptions { force?: boolean; noIgnore?: boolean; autoProps?: boolean; noAutoProps?: boolean; parents?: boolean; }
  • index.ts:361-400 (registration)
    MCP server tool registration for 'svn_add', including Zod input schema validation and thin wrapper handler that delegates to SvnService.add and formats the response.
    server.tool( "svn_add", "Añadir archivos al control de versiones", { paths: z.union([z.string(), z.array(z.string())]).describe("Archivo(s) o directorio(s) a añadir"), force: z.boolean().optional().default(false).describe("Forzar adición"), noIgnore: z.boolean().optional().default(false).describe("No respetar reglas de ignore"), parents: z.boolean().optional().default(false).describe("Crear directorios padre si es necesario"), autoProps: z.boolean().optional().describe("Aplicar auto-propiedades"), noAutoProps: z.boolean().optional().describe("No aplicar auto-propiedades") }, async (args) => { try { const options = { force: args.force, noIgnore: args.noIgnore, parents: args.parents, autoProps: args.autoProps, noAutoProps: args.noAutoProps }; const result = await getSvnService().add(args.paths, options); const pathsArray = Array.isArray(args.paths) ? args.paths : [args.paths]; const addText = `➕ **Archivos Añadidos**\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: addText }], }; } catch (error: any) { return { content: [{ type: "text", text: `❌ **Error:** ${error.message}` }], }; } } );

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