Skip to main content
Glama

validate_jenkins_config

Validate Jenkins configuration for errors and status to ensure integrity and reliability in CI/CD pipelines using the Jenkins MCP Tool.

Instructions

Validate the integrity of Jenkins configuration.

Returns: Validation result, including error list and status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function decorated with @mcp.tool(), which implements the core logic of the validate_jenkins_config tool. It validates Jenkins servers and scenarios, collects errors, and returns a validation result dictionary.
    @mcp.tool() def validate_jenkins_config() -> dict: """Validate the integrity of Jenkins configuration. Returns: Validation result, including error list and status """ errors = [] # Validate server config try: servers = get_jenkins_servers() if not servers: errors.append("No Jenkins servers configured") else: for server in servers: required_fields = ["name", "uri", "user", "token"] for field in required_fields: if field not in server or not server[field]: errors.append( f"Server '{server.get('name', 'unknown')}' missing field: {field}" ) except Exception as e: errors.append(f"Failed to load server configuration: {e}") # Validate scenario config scenario_errors = ScenarioManager.validate_scenario_config() errors.extend(scenario_errors) return {"valid": len(errors) == 0, "errors": errors, "error_count": len(errors)}
  • Supporting helper method in ScenarioManager that validates scenario configurations for required fields and server validity. Called within the main handler to check scenarios.
    def validate_scenario_config() -> List[str]: """Validate the integrity of scenario configuration. Returns: List of validation errors (empty list means no errors) """ errors = [] try: scenario_mapping = get_scenario_mapping() if not scenario_mapping: errors.append("No scenarios configured") return errors for scenario_name, config in scenario_mapping.items(): # Check required fields required_fields = ["description", "server", "job_path"] for field in required_fields: if field not in config: errors.append( f"Scenario '{scenario_name}' missing required field: {field}" ) # Check if server exists if "server" in config: try: JenkinsAPIClient._get_server_config(config["server"]) except Exception as e: errors.append( f"Scenario '{scenario_name}' references invalid server '{config['server']}': {e}" ) except Exception as e: errors.append(f"Failed to load scenario configuration: {e}") return errors

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/xhuaustc/jenkins-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server