Skip to main content
Glama
gcorroto

SVN MCP Server

by gcorroto

svn_info

Retrieve detailed information about SVN working copies or specific files to manage repository data and track version control status.

Instructions

Obtener información detallada del working copy o archivo específico

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoRuta específica a consultar (opcional)

Implementation Reference

  • Core handler method in SvnService that executes the 'svn info' command on the specified path or working directory, parses the output, and returns structured SvnInfo data.
    async getInfo(path?: string): Promise<SvnResponse<SvnInfo>> {
      try {
        const args = ['info'];
        if (path) {
          // Check if it's a URL or a local path
          if (validateSvnUrl(path)) {
            // It's a URL, add it directly without normalization
            args.push(path);
          } else if (validatePath(path)) {
            // It's a local path, normalize it
            args.push(normalizePath(path));
          } else {
            throw new SvnError(`Invalid path or URL: ${path}`);
          }
        }
    
        const response = await executeSvnCommand(this.config, args);
        const info = parseInfoOutput(cleanOutput(response.data as string));
    
        return {
          success: true,
          data: info,
          command: response.command,
          workingDirectory: response.workingDirectory,
          executionTime: response.executionTime
        };
    
      } catch (error: any) {
        this.handleSvnError(error, 'get SVN info');
      }
    }
  • index.ts:115-149 (registration)
    MCP server registration of the 'svn_info' tool, including input schema and wrapper handler that calls SvnService.getInfo and formats markdown response.
    server.tool(
      "svn_info",
      "Obtener información detallada del working copy o archivo específico",
      {
        path: z.string().optional().describe("Ruta específica a consultar (opcional)")
      },
      async (args) => {
        try {
          const result = await getSvnService().getInfo(args.path);
          const info = result.data!;
          
          const infoText = `📋 **Información SVN**\n\n` +
            `**Ruta:** ${info.path}\n` +
            `**URL:** ${info.url}\n` +
            `**URL Relativa:** ${info.relativeUrl}\n` +
            `**Raíz del Repositorio:** ${info.repositoryRoot}\n` +
            `**UUID:** ${info.repositoryUuid}\n` +
            `**Revisión:** ${info.revision}\n` +
            `**Tipo de Nodo:** ${info.nodeKind}\n` +
            `**Último Autor:** ${info.lastChangedAuthor}\n` +
            `**Última Revisión:** ${info.lastChangedRev}\n` +
            `**Última Fecha:** ${info.lastChangedDate}\n` +
            `**Raíz Working Copy:** ${info.workingCopyRootPath}\n` +
            `**Tiempo de Ejecución:** ${formatDuration(result.executionTime || 0)}`;
    
          return {
            content: [{ type: "text", text: infoText }],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `❌ **Error:** ${error.message}` }],
          };
        }
      }
    );
  • Input schema for the 'svn_info' tool using Zod: optional path parameter.
    {
      path: z.string().optional().describe("Ruta específica a consultar (opcional)")
    },
  • TypeScript interface defining the structure of SVN info output data.
    export interface SvnInfo {
      path: string;
      workingCopyRootPath: string;
      url: string;
      relativeUrl: string;
      repositoryRoot: string;
      repositoryUuid: string;
      revision: number;
      nodeKind: 'file' | 'directory';
      schedule: string;
      lastChangedAuthor: string;
      lastChangedRev: number;
      lastChangedDate: string;
      textLastUpdated?: string;
      checksum?: string;
    }
  • Helper function that parses the raw output from 'svn info' command into structured SvnInfo object.
    export function parseInfoOutput(output: string): SvnInfo {
      const lines = output.split('\n');
      const info: Partial<SvnInfo> = {};
      
      for (const line of lines) {
        const [key, ...valueParts] = line.split(': ');
        const value = valueParts.join(': ').trim();
        
        switch (key.trim()) {
          case 'Path':
            info.path = value;
            break;
          case 'Working Copy Root Path':
            info.workingCopyRootPath = value;
            break;
          case 'URL':
            info.url = value;
            break;
          case 'Relative URL':
            info.relativeUrl = value;
            break;
          case 'Repository Root':
            info.repositoryRoot = value;
            break;
          case 'Repository UUID':
            info.repositoryUuid = value;
            break;
          case 'Revision':
            info.revision = parseInt(value, 10);
            break;
          case 'Node Kind':
            info.nodeKind = value as 'file' | 'directory';
            break;
          case 'Schedule':
            info.schedule = value;
            break;
          case 'Last Changed Author':
            info.lastChangedAuthor = value;
            break;
          case 'Last Changed Rev':
            info.lastChangedRev = parseInt(value, 10);
            break;
          case 'Last Changed Date':
            info.lastChangedDate = value;
            break;
          case 'Text Last Updated':
            info.textLastUpdated = value;
            break;
          case 'Checksum':
            info.checksum = value;
            break;
        }
      }
      
      return info as SvnInfo;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is an information retrieval operation ('obtener información'), which implies it's likely read-only, but doesn't confirm this or describe any other behavioral traits like error handling, output format, or performance characteristics. This leaves significant gaps for a tool with no annotation coverage.

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 unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the complexity of SVN operations and the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'información detallada' includes, how results are structured, or any prerequisites (e.g., requires an SVN working copy). For a tool in a domain with many siblings, this leaves too much ambiguity.

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 single parameter 'path' documented as an optional string for a specific route to query. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 where the schema does the heavy lifting.

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 verb ('obtener información detallada') and resource ('working copy o archivo específico'), making the purpose understandable. However, it doesn't explicitly differentiate this from sibling tools like 'svn_status' or 'svn_log' which might also provide information about SVN repositories, missing full sibling distinction.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'svn_status' and 'svn_log' that might offer different types of information, the description lacks any context about when this specific info retrieval is appropriate, leaving the agent to guess based on tool names alone.

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