Skip to main content
Glama

svn_checkout

Check out files from an SVN repository to a local directory, specifying revision, depth, and other options for repository management.

Instructions

Hacer checkout de un repositorio SVN

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL del repositorio SVN
pathNoDirectorio destino
revisionNoRevisión específica
depthNoProfundidad del checkout
forceNoForzar checkout
ignoreExternalsNoIgnorar externals

Implementation Reference

  • Core handler function that implements the SVN checkout logic by building command arguments (revision, depth, force, ignore-externals) and executing the 'svn checkout' command.
    async checkout( url: string, path?: string, options: SvnCheckoutOptions = {} ): Promise<SvnResponse<string>> { try { if (!validateSvnUrl(url)) { throw new SvnError(`Invalid SVN URL: ${url}`); } const args = ['checkout']; if (options.revision) { args.push('--revision', options.revision.toString()); } if (options.depth) { args.push('--depth', options.depth); } if (options.force) { args.push('--force'); } if (options.ignoreExternals) { args.push('--ignore-externals'); } args.push(url); 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 checkout: ${error.message}`); } }
  • index.ts:282-319 (registration)
    MCP tool registration for 'svn_checkout', including input schema with Zod validation and thin wrapper handler that delegates to SvnService.checkout.
    "svn_checkout", "Hacer checkout de un repositorio SVN", { url: z.string().describe("URL del repositorio SVN"), path: z.string().optional().describe("Directorio destino"), revision: z.union([z.number(), z.literal("HEAD")]).optional().describe("Revisión específica"), depth: z.enum(["empty", "files", "immediates", "infinity"]).optional().describe("Profundidad del checkout"), force: z.boolean().optional().default(false).describe("Forzar checkout"), ignoreExternals: z.boolean().optional().default(false).describe("Ignorar externals") }, async (args) => { try { const options = { revision: args.revision, depth: args.depth, force: args.force, ignoreExternals: args.ignoreExternals }; const result = await getSvnService().checkout(args.url, args.path, options); const checkoutText = `📥 **Checkout Completado**\n\n` + `**URL:** ${args.url}\n` + `**Destino:** ${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: checkoutText }], }; } catch (error: any) { return { content: [{ type: "text", text: `❌ **Error:** ${error.message}` }], }; } } );
  • TypeScript interface defining the options schema for SVN checkout operation.
    export interface SvnCheckoutOptions { revision?: number | 'HEAD'; depth?: 'empty' | 'files' | 'immediates' | 'infinity'; force?: boolean; ignoreExternals?: boolean; }
  • MCP tool handler function that validates input, maps args to options, calls the core SvnService.checkout, formats success/error response with execution details.
    async (args) => { try { const options = { revision: args.revision, depth: args.depth, force: args.force, ignoreExternals: args.ignoreExternals }; const result = await getSvnService().checkout(args.url, args.path, options); const checkoutText = `📥 **Checkout Completado**\n\n` + `**URL:** ${args.url}\n` + `**Destino:** ${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: checkoutText }], }; } catch (error: any) { return { content: [{ type: "text", text: `❌ **Error:** ${error.message}` }], }; }

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