Skip to main content
Glama

svn_diagnose

Diagnose and resolve specific issues with SVN commands using this tool, part of the SVN MCP Server, designed to streamline SVN repository management.

Instructions

Diagnosticar problemas específicos con comandos SVN

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler logic for svn_diagnose tool. Tests svn status (local/remote) and log commands, categorizes errors, and provides diagnostic results.
    async diagnoseCommands(): Promise<SvnResponse<{ statusLocal: boolean; statusRemote: boolean; logBasic: boolean; workingCopyPath: string; errors: string[]; suggestions: string[]; }>> { const results = { statusLocal: false, statusRemote: false, logBasic: false, workingCopyPath: this.config.workingDirectory!, errors: [] as string[], suggestions: [] as string[] }; try { // Probar svn status local try { await executeSvnCommand(this.config, ['status']); results.statusLocal = true; } catch (error: any) { const errorMsg = this.categorizeError(error, 'status local'); results.errors.push(errorMsg.message); if (errorMsg.suggestion) { results.suggestions.push(errorMsg.suggestion); } } // Probar svn status con --show-updates try { await executeSvnCommand(this.config, ['status', '--show-updates']); results.statusRemote = true; } catch (error: any) { const errorMsg = this.categorizeError(error, 'status remoto'); results.errors.push(errorMsg.message); if (errorMsg.suggestion) { results.suggestions.push(errorMsg.suggestion); } } // Probar svn log básico try { await executeSvnCommand(this.config, ['log', '--limit', '1']); results.logBasic = true; } catch (error: any) { const errorMsg = this.categorizeError(error, 'log básico'); results.errors.push(errorMsg.message); if (errorMsg.suggestion) { results.suggestions.push(errorMsg.suggestion); } } // Agregar sugerencias generales basadas en los resultados if (!results.statusRemote && !results.logBasic && results.statusLocal) { results.suggestions.push('Los comandos remotos fallan pero el local funciona. Revisa la conectividad de red y credenciales SVN.'); } return { success: true, data: results, command: 'diagnostic', workingDirectory: this.config.workingDirectory! }; } catch (error: any) { results.errors.push(`Error general: ${error.message}`); return { success: false, data: results, error: error.message, command: 'diagnostic', workingDirectory: this.config.workingDirectory! }; } }
  • index.ts:68-112 (registration)
    MCP server.tool registration for 'svn_diagnose', including thin wrapper handler that calls SvnService.diagnoseCommands() and formats output as Markdown.
    server.tool( "svn_diagnose", "Diagnosticar problemas específicos con comandos SVN", {}, async () => { try { const result = await getSvnService().diagnoseCommands(); const data = result.data!; const statusLocalIcon = data.statusLocal ? '✅' : '❌'; const statusRemoteIcon = data.statusRemote ? '✅' : '❌'; const logIcon = data.logBasic ? '✅' : '❌'; let diagnosticText = `🔍 **Diagnóstico de Comandos SVN**\n\n` + `**Directorio de Trabajo:** ${data.workingCopyPath}\n\n` + `${statusLocalIcon} **Status Local:** ${data.statusLocal ? 'Funciona' : 'Falló'}\n` + `${statusRemoteIcon} **Status Remoto:** ${data.statusRemote ? 'Funciona' : 'Falló'}\n` + `${logIcon} **Log Básico:** ${data.logBasic ? 'Funciona' : 'Falló'}\n`; if (data.errors.length > 0) { diagnosticText += `\n**Errores Detectados:**\n`; data.errors.forEach((error, index) => { diagnosticText += `${index + 1}. ${error}\n`; }); } // Añadir sugerencias basadas en los errores if (!data.statusRemote || !data.logBasic) { diagnosticText += `\n**Posibles Soluciones:**\n`; diagnosticText += `• Verificar conexión a internet\n`; diagnosticText += `• Verificar credenciales de SVN\n`; diagnosticText += `• Ejecutar 'svn cleanup' si hay problemas de lock\n`; diagnosticText += `• Verificar que el working copy esté actualizado\n`; } return { content: [{ type: "text", text: diagnosticText }], }; } catch (error: any) { return { content: [{ type: "text", text: `❌ **Error en diagnóstico:** ${error.message}` }], }; } } );
  • Helper method used by diagnoseCommands to categorize SVN errors and provide specific suggestions based on error codes and messages.
    private categorizeError(error: any, commandType: string): { message: string; suggestion?: string } { const baseMessage = `${commandType} falló`; // SVN no encontrado en el sistema if ((error.message.includes('spawn') && error.message.includes('ENOENT')) || error.code === 127) { return { message: `${baseMessage}: SVN no está instalado o no se encuentra en el PATH`, suggestion: 'Instala SVN (subversion) o verifica que esté en el PATH del sistema' }; } // Errores de conectividad if (error.message.includes('E175002') || error.message.includes('Unable to connect') || error.message.includes('Connection refused') || error.message.includes('Network is unreachable')) { return { message: `${baseMessage}: Sin conectividad al servidor SVN`, suggestion: 'Verifica tu conexión a internet y que el servidor SVN esté accesible' }; } // Errores de autenticación - demasiados intentos if (error.message.includes('E215004') || error.message.includes('No more credentials') || error.message.includes('we tried too many times')) { return { message: `${baseMessage}: Demasiados intentos de autenticación fallidos`, suggestion: 'Las credenciales pueden estar incorrectas o cachadas. Limpia el cache de credenciales SVN y verifica SVN_USERNAME y SVN_PASSWORD' }; } // Errores de autenticación generales if (error.message.includes('E170001') || error.message.includes('Authentication failed') || error.message.includes('authorization failed')) { return { message: `${baseMessage}: Error de autenticación`, suggestion: 'Verifica tus credenciales SVN (SVN_USERNAME y SVN_PASSWORD)' }; } // Working copy no válido if (error.message.includes('E155007') || error.message.includes('not a working copy')) { return { message: `${baseMessage}: No es un working copy válido`, suggestion: 'Asegúrate de estar en un directorio con checkout de SVN o ejecuta svn checkout primero' }; } // Working copy bloqueado if (error.message.includes('E155036') || error.message.includes('working copy locked')) { return { message: `${baseMessage}: Working copy bloqueado`, suggestion: 'Ejecuta "svn cleanup" para desbloquear el working copy' }; } // Error genérico con código 1 (frecuente en comandos remotos) if (error.code === 1) { return { message: `${baseMessage}: Comando falló con código 1 (posible problema de red/autenticación)`, suggestion: 'Revisa conectividad de red, credenciales SVN, y que el repositorio sea accesible' }; } // Error genérico return { message: `${baseMessage}: ${error.message}`, suggestion: undefined }; }

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