Skip to main content
Glama
ZeroPathAI

ZeroPath MCP Server

Official
by ZeroPathAI

generate_patch

Create automated security patches to fix identified vulnerabilities by providing the issue ID.

Instructions

Generate an automated patch/fix for a security issue.

Args:
    issue_id: The ID of the issue to generate a patch for

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issue_idYes

Implementation Reference

  • The MCP tool handler for 'generate_patch'. Decorated with @mcp.tool() for automatic registration. Calls the ZeroPath API to generate a patch for the specified issue_id.
    @mcp.tool()
    def generate_patch(issue_id: str) -> str:
        """
        Generate an automated patch/fix for a security issue.
    
        Args:
            issue_id: The ID of the issue to generate a patch for
        """
        if not issue_id:
            return "Error: Issue ID is required"
    
        response, error = make_api_request(
            "issues/generate-patch",
            {"issueId": issue_id}
        )
    
        if error:
            return error
    
        if response.status_code == 200:
            result = response.json()
            if result.get("patch"):
                return f"Patch generated successfully for issue {issue_id}. Use get_issue({issue_id}) to view the patch details."
            return f"Patch generation initiated for issue {issue_id}. This may take a moment."
        elif response.status_code == 401:
            return "Error: Unauthorized - check API credentials"
        elif response.status_code == 400:
            return f"Error: Bad request - {response.text}"
        else:
            return f"Error: API returned status {response.status_code}: {response.text}"

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/ZeroPathAI/zeropath-mcp-server'

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