Skip to main content
Glama
xhuaustc

Jenkins MCP Tool

get_scenario_list

Retrieve pre-configured Jenkins deployment scenarios to ensure correct server and job configurations before executing deployment tasks.

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function decorated with @mcp.tool(), which registers and executes the get_scenario_list tool by delegating to ScenarioManager.
    @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 implementation logic in ScenarioManager.get_scenario_list(), loads scenario mapping from config and formats into ScenarioInfo list.
    @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 scenario returned by get_scenario_list.
    class ScenarioInfo(TypedDict):
        """Scenario info."""
    
        index: str
        name: str
        description: str
        server: str
        job_path: str
  • @mcp.tool() decorator registers the get_scenario_list function as an MCP tool.
    @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()
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It effectively describes what the tool returns (a list of scenarios with specific fields) and its role in the deployment workflow. However, it doesn't mention potential limitations like rate limits, authentication requirements, or error conditions, which would be helpful for a tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose. Every sentence adds value: the first states the purpose and usage rule, the second explains the return value, and the workflow section provides actionable guidance. There's no redundant or wasted information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, an output schema exists, and no annotations are provided, the description is complete. It explains what the tool does, when to use it, what it returns, and how it fits into a broader workflow. The output schema likely covers the return structure, so the description doesn't need to duplicate that detail.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters, focusing instead on the tool's purpose and output. No additional parameter semantics are needed or provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool's purpose: 'Get all available application scenarios' and identifies it as 'the preferred entry point for deployment tasks.' It clearly distinguishes this from sibling tools like 'search_jobs' by explaining this should be called first instead of directly using search_jobs. The verb 'get' and resource 'scenario list' are specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool versus alternatives: 'For any deployment-related task, this function should be called first instead of directly using search_jobs.' It also outlines a complete workflow with specific sibling tools (search_jobs_by_scenario and trigger_build), giving clear context and exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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