Skip to main content
Glama

get_scenario_list

Retrieve pre-configured application scenarios for deployment tasks. Start by calling this function to obtain a list of scenarios with server and job paths, enabling streamlined CI/CD workflows on Jenkins MCP Tool.

Instructions

Get all available application scenarios - the preferred entry point for deployment tasks.

Important: For any deployment-related task, this function should be called first instead of directly using search_jobs. This function returns a pre-configured scenario list, each containing the correct server and job path configuration. Returns: List of scenarios, each containing: - index: Scenario index (string) - name: Scenario name - description: Scenario description - server: Jenkins server name - job_path: Job path Workflow: 1. Call this function to get the scenario list 2. Let the user select a scenario 3. Use search_jobs_by_scenario(scenario) to get the specific job 4. Use trigger_build() to execute deployment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler and registration for 'get_scenario_list'. This decorated function serves as the entry point for the tool, delegating to ScenarioManager.get_scenario_list().
    @mcp.tool() def get_scenario_list() -> List[ScenarioInfo]: """Get all available application scenarios - the preferred entry point for deployment tasks. Important: For any deployment-related task, this function should be called first instead of directly using search_jobs. This function returns a pre-configured scenario list, each containing the correct server and job path configuration. Returns: List of scenarios, each containing: - index: Scenario index (string) - name: Scenario name - description: Scenario description - server: Jenkins server name - job_path: Job path Workflow: 1. Call this function to get the scenario list 2. Let the user select a scenario 3. Use search_jobs_by_scenario(scenario) to get the specific job 4. Use trigger_build() to execute deployment """ return ScenarioManager.get_scenario_list()
  • Core helper function implementing get_scenario_list logic in ScenarioManager class. Loads scenario mapping from config, constructs ScenarioInfo list with indices.
    @staticmethod def get_scenario_list() -> List[ScenarioInfo]: """Get all available application scenarios. Important: For any deployment-related task, this function should be called first instead of directly using search_jobs. This function returns a pre-configured scenario list, each containing the correct server and job path configuration. Returns: List of scenarios, each containing: - index: Scenario index (string) - name: Scenario name - description: Scenario description - server: Jenkins server name - job_path: Job path Workflow: 1. Call this function to get the scenario list 2. Let the user select a scenario 3. Use search_jobs_by_scenario(scenario) to get the specific job 4. Use trigger_build() to execute deployment Raises: JenkinsConfigurationError: Configuration error """ try: scenario_mapping = get_scenario_mapping() scenarios = [] for i, (name, config) in enumerate(scenario_mapping.items()): scenarios.append( { "index": str(i + 1), "name": name, "description": config["description"], "server": config["server"], "job_path": config["job_path"], } ) logger.info(f"Found {len(scenarios)} deployment scenarios") return scenarios except Exception as e: logger.error(f"Failed to get scenario list: {e}") raise JenkinsConfigurationError(f"Failed to get scenario list: {e}") from e
  • TypedDict schema defining the structure of each ScenarioInfo returned by get_scenario_list.
    class ScenarioInfo(TypedDict): """Scenario info.""" index: str name: str description: str server: str job_path: str

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