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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/jenkins/tools/mcp_tools.py:35-56 (handler)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()
- src/jenkins/tools/scenarios.py:19-63 (helper)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
- src/jenkins/tools/types.py:139-147 (schema)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