Skip to main content
Glama

set_item_config

Update a Jenkins item's configuration by providing its full name and new config XML. Replace existing config with the specified XML data.

Instructions

Set specific item config in Jenkins

Args: fullname: The fullname of the item config_xml: The config XML of the item

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullnameYes
config_xmlYes

Implementation Reference

  • MCP tool handler for set_item_config — the async function decorated with @mcp.tool(tags=['write']) that receives the context, fullname, and config_xml, then delegates to the Jenkins rest client.
    @mcp.tool(tags=['write'])
    async def set_item_config(ctx: Context, fullname: str, config_xml: str) -> None:
        """Set specific item config in Jenkins
    
        Args:
            fullname: The fullname of the item
            config_xml: The config XML of the item
        """
        jenkins(ctx).set_item_config(fullname=fullname, config_xml=config_xml)
  • Registration of set_item_config as an MCP tool via the @mcp.tool decorator with tags=['write'].
    @mcp.tool(tags=['write'])
  • The REST client method that performs the actual POST request to Jenkins. Parses the fullname into folder/name, then calls the ITEM_CONFIG endpoint with the config_xml payload and Content-Type: text/xml header.
    def set_item_config(self, *, fullname: str, config_xml: str) -> None:
        """Set item configuration by its fullname.
    
        Args:
            fullname: The full name of the item (e.g., "folder1/folder2/item").
            config_xml: The item configuration as an XML string.
        """
        folder, name = self._parse_fullname(fullname)
        self.request(
            'POST',
            rest_endpoint.ITEM_CONFIG(folder=folder, name=name),
            headers=self.DEFAULT_HEADERS,
            data=config_xml,
        )
  • The REST endpoint definition for item config operations (both get and set). Uses the RestEndpoint class which formats the URL with folder and name parameters.
    ITEM_CONFIG = RestEndpoint('{folder}job/{name}/config.xml')
  • Helper that parses a slash-separated fullname into a Jenkins folder path and item name.
    def _parse_fullname(self, fullname: str) -> tuple[str, str]:
        """Parse a fullname into folder URL and short name.
    
        Args:
            fullname: A string representing the full path (e.g., "folder1/folder2/name").
    
        Returns:
            A tuple containing:
                - folder: The constructed folder URL (e.g., "job/folder1/job/folder2/").
                - name: The last component of the path (e.g., "name").
        """
        parts = fullname.split('/')
        name = parts[-1]
        folder = f'job/{"/job/".join(parts[:-1])}/' if len(parts) > 1 else ''
        return folder, name
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Set' implying mutation but fails to disclose side effects, permission requirements, or whether the operation is idempotent or replaces existing config.

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

Conciseness3/5

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

The description is short and to the point, but lacks structured formatting. The purpose line is front-loaded, but the parameter list is minimal and not integrated into a flow.

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

Completeness2/5

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

With 2 parameters, no output schema, and no annotations, the description is incomplete. It does not explain the effect on existing configuration, whether the tool is additive or replace, or any success/error responses.

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

Parameters2/5

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

Schema description coverage is 0%, so description must compensate. It lists two parameters but only repeats their names as explanations. Does not clarify format of config_xml or how to obtain the fullname.

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

Purpose4/5

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

The description uses the verb 'Set' and specifies 'item config in Jenkins', clearly indicating a modification operation. It distinguishes from sibling tools like get_item_config (read-only) and set_node_config (different resource).

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives. Siblings like get_item_config exist but are not mentioned. No prerequisites or conditions are provided.

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

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