close_engagement
Terminate an engagement in DefectDojo by specifying its ID using this MCP server tool. Simplifies vulnerability management workflows by programmatically closing engagements.
Instructions
Close an engagement
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| engagement_id | Yes |
Implementation Reference
- The core handler function that implements the 'close_engagement' tool by updating the engagement's status to 'Completed' via the DefectDojo API client.async def close_engagement(engagement_id: int) -> Dict[str, Any]: """Close an engagement by setting its status to completed. Args: engagement_id: ID of the engagement to close Returns: Dictionary with status and data/error """ # Use the specific status string from the API schema data = { "status": "Completed" } client = get_client() # Use the update_engagement client method result = await client.update_engagement(engagement_id, data) if "error" in result: return {"status": "error", "error": result["error"], "details": result.get("details", "")} # Check if the update was successful (API might return updated object or just status) # Assuming success if no error is present return {"status": "success", "data": result}
- src/defectdojo/tools.py:85-88 (registration)The primary registration of the 'close_engagement' tool with the MCP server instance in the central tools.py file.mcp.tool( name="close_engagement", description="Close an engagement" )(close_engagement)
- src/defectdojo/engagements_tools.py:233-233 (registration)Secondary or module-local registration of the 'close_engagement' tool within the engagements_tools.py module.mcp.tool(name="close_engagement", description="Close an engagement")(close_engagement)