Skip to main content
Glama
gcorroto

SVN MCP Server

by gcorroto

svn_status

Check the status of files in your SVN working copy to see modifications, additions, or deletions before committing changes.

Instructions

Ver el estado de archivos en el working copy

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoRuta específica a consultar
showAllNoMostrar estado remoto también

Implementation Reference

  • Core handler function that executes 'svn status' command (with optional --show-updates for remote status), parses the output using parseStatusOutput, and returns structured SvnStatus[]
    async getStatus(path?: string, showAll: boolean = false): Promise<SvnResponse<SvnStatus[]>> {
      try {
        const args = ['status'];
        
        if (path) {
          if (!validatePath(path)) {
            throw new SvnError(`Invalid path: ${path}`);
          }
          args.push(normalizePath(path));
        }
    
        let response;
        
        // Si showAll es true, intentar primero con --show-updates
        if (showAll) {
          try {
            const argsWithUpdates = [...args, '--show-updates'];
            response = await executeSvnCommand(this.config, argsWithUpdates);
          } catch (error: any) {
            // Si falla con --show-updates, intentar sin él
            console.warn(`Warning: --show-updates failed, falling back to local status only: ${error.message}`);
            response = await executeSvnCommand(this.config, args);
          }
        } else {
          response = await executeSvnCommand(this.config, args);
        }
    
        const statusList = parseStatusOutput(cleanOutput(response.data as string));
    
        return {
          success: true,
          data: statusList,
          command: response.command,
          workingDirectory: response.workingDirectory,
          executionTime: response.executionTime
        };
    
      } catch (error: any) {
        this.handleSvnError(error, 'get SVN status');
      }
    }
  • index.ts:152-201 (registration)
    MCP server registration of 'svn_status' tool, including Zod input schema (path?: string, showAll?: boolean) and wrapper handler that calls SvnService.getStatus and formats response with icons
    server.tool(
      "svn_status",
      "Ver el estado de archivos en el working copy",
      {
        path: z.string().optional().describe("Ruta específica a consultar"),
        showAll: z.boolean().optional().default(false).describe("Mostrar estado remoto también")
      },
      async (args) => {
        try {
          const result = await getSvnService().getStatus(args.path, args.showAll);
          const statusList = result.data!;
          
          if (statusList.length === 0) {
            return {
              content: [{ type: "text", text: "✅ **No hay cambios en el working copy**" }],
            };
          }
    
                 const statusText = `📊 **Estado SVN** (${statusList.length} elementos)\n\n` +
             statusList.map(status => {
               const statusIcon: {[key: string]: string} = {
                 'added': '➕',
                 'deleted': '➖',
                 'modified': '✏️',
                 'replaced': '🔄',
                 'merged': '🔀',
                 'conflicted': '⚠️',
                 'ignored': '🙈',
                 'none': '⚪',
                 'normal': '✅',
                 'external': '🔗',
                 'incomplete': '⏸️',
                 'unversioned': '❓',
                 'missing': '❌'
               };
               
               return `${statusIcon[status.status] || '📄'} **${status.status.toUpperCase()}** - ${status.path}`;
             }).join('\n') +
             `\n\n**Tiempo de Ejecución:** ${formatDuration(result.executionTime || 0)}`;
    
           return {
             content: [{ type: "text", text: statusText }],
           };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `❌ **Error:** ${error.message}` }],
          };
        }
      }
    );
  • Zod input schema validation for svn_status tool parameters
    {
      path: z.string().optional().describe("Ruta específica a consultar"),
      showAll: z.boolean().optional().default(false).describe("Mostrar estado remoto también")
    },
  • TypeScript interface defining the structure of SVN status entries returned by the tool
    export interface SvnStatus {
      path: string;
      status: 'unversioned' | 'added' | 'deleted' | 'modified' | 'replaced' | 'merged' | 'conflicted' | 'ignored' | 'none' | 'normal' | 'external' | 'incomplete';
      revision?: number;
      changedRev?: number;
      changedAuthor?: string;
      changedDate?: string;
    }
  • Utility function to parse raw 'svn status' command output into array of SvnStatus objects using SVN_STATUS_CODES mapping
    export function parseStatusOutput(output: string): SvnStatus[] {
      const lines = output.split('\n').filter(line => line.trim());
      const statusList: SvnStatus[] = [];
      
      for (const line of lines) {
        if (line.length < 8) continue;
        
        const statusCode = line[0];
        const propStatusCode = line[1];
        const path = line.substring(8).trim();
        
        const status: SvnStatus = {
          path,
          status: (SVN_STATUS_CODES as any)[statusCode] || 'unknown'
        };
        
        statusList.push(status);
      }
      
      return statusList;
    }
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 the tool checks file status but doesn't describe what 'estado' entails (e.g., modified, added, conflicted), whether it's read-only or has side effects, or how results are presented. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior and safety.

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 unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence earns its place by conveying essential information concisely.

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 (a version control status tool with 2 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the status output includes, potential side effects, or error conditions. For a tool that likely returns detailed file information, more context is needed to use it effectively without trial and error.

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?

Schema description coverage is 100%, so the schema already documents both parameters ('path' and 'showAll') with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as examples or contextual usage. Baseline 3 is appropriate when the schema does the heavy lifting, but no extra value is added.

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 'Ver el estado de archivos en el working copy' clearly states the tool's purpose: checking the status of files in a working copy. It uses specific verbs ('ver el estado') and identifies the resource ('archivos en el working copy'), which distinguishes it from siblings like svn_commit or svn_update. However, it doesn't explicitly differentiate from all siblings (e.g., svn_info might also provide status-like information), so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a working copy), exclusions, or comparisons to siblings like svn_info or svn_diff. Without such context, users must infer usage from the purpose alone, which is insufficient for optimal tool selection.

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