{"code": "EXPIRED_TOKEN","message": "Authentication token has expired","details": {"expiredAt": "2025-12-09T10:30:00Z","hint": "Refresh your token and try again"}}
{"code": "FORBIDDEN","message": "You don't have permission to perform this action","details": {"required": "owner","current": "user","resource": "server:weather-mcp"}}
{"code": "VALIDATION_ERROR","message": "Request validation failed","details": {"errors": [{"field": "name","message": "Server name must be lowercase with hyphens","value": "MyServer123"},{"field": "version","message": "Version must follow semver format","value": "1.0"}]}}
{"code": "MISSING_REQUIRED_FIELD","message": "Required field is missing","details": {"field": "entrypoint","hint": "Specify the entry point file for your server"}}
{"code": "RESOURCE_NOT_FOUND","message": "Server not found","details": {"resource": "server","identifier": "non-existent-server","hint": "Check the server name and try again"}}
{"code": "RESOURCE_ALREADY_EXISTS","message": "Server with this name already exists","details": {"resource": "server","name": "weather-mcp","existingVersion": "1.2.0","hint": "Choose a different name or update the existing server"}}
{"code": "RESOURCE_CONFLICT","message": "Cannot delete server while it's being executed","details": {"resource": "server","name": "weather-mcp","state": "executing","hint": "Wait for execution to complete or cancel it first"}}
{"code": "REPOSITORY_UNREACHABLE","message": "Unable to access Git repository","details": {"url": "https://github.com/user/repo","reason": "Repository is private or doesn't exist","hint": "Ensure the repository is public and URL is correct"}}
Repository doesn’t have valid MCP server structure
{"code": "REPOSITORY_INVALID_STRUCTURE","message": "Repository doesn't contain a valid MCP server","details": {"missingFiles": ["main.py", "requirements.txt"],"hint": "Ensure your repository has all required files"}}
{"code": "SECRETS_DETECTED","message": "Secret keys detected in repository","details": {"secretsFound": 2,"types": ["API Key", "AWS Access Key"],"hint": "Remove all secrets from your code and use environment variables"}}
{"code": "INTERNAL_ERROR","message": "An unexpected error occurred","details": {"requestId": "req_abc123def456","hint": "Contact support with this request ID"}}
function validateServerData(data) { const errors = []; // Name validation if (!/^[a-z0-9-]+$/.test(data.name)) { errors.push({field: 'name',message: 'Name must be lowercase with hyphens only' }); } // Version validation if (!/^\d+\.\d+\.\d+$/.test(data.version)) { errors.push({field: 'version',message: 'Version must follow semver format (x.y.z)' }); } // Repository URL validation const urlPattern = /^https:\/\/github\.com\/[\w-]+\/[\w-]+$/; if (!urlPattern.test(data.repository?.url)) { errors.push({field: 'repository.url',message: 'Must be a valid GitHub repository URL' }); } if (errors.length > 0) { throw new ValidationError('Validation failed', errors); }}