Skip to main content
Glama
jamiesonio

DefectDojo MCP Server

by jamiesonio

create_finding

Generate and manage findings in DefectDojo by specifying title, test ID, severity, and description to streamline vulnerability tracking and resolution.

Instructions

Create a new finding

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cvssv3No
cweNo
descriptionYes
impactNo
mitigationNo
severityYes
steps_to_reproduceNo
test_idYes
titleYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'create_finding' tool. It validates inputs, constructs the data payload, calls the DefectDojo client to create the finding, and returns the result.
    async def create_finding(title: str, test_id: int, severity: str, description: str,
                            cwe: Optional[int] = None, cvssv3: Optional[str] = None,
                            mitigation: Optional[str] = None, impact: Optional[str] = None,
                            steps_to_reproduce: Optional[str] = None) -> Dict[str, Any]:
        """Create a new finding.
    
        Args:
            title: Title of the finding
            test_id: ID of the test to associate the finding with
            severity: Severity level (Critical, High, Medium, Low, Info)
            description: Description of the finding
            cwe: Optional CWE identifier
            cvssv3: Optional CVSS v3 score string
            mitigation: Optional mitigation steps
            impact: Optional impact description
            steps_to_reproduce: Optional steps to reproduce
    
        Returns:
            Dictionary with status and data/error
        """
        # Validate severity (case-insensitive check, but send capitalized)
        valid_severities = ["critical", "high", "medium", "low", "info"]
        normalized_severity = severity.lower()
        if normalized_severity not in valid_severities:
            # Use title case for user-facing error message
            valid_display = [s.title() for s in valid_severities]
            return {"status": "error", "error": f"Invalid severity '{severity}'. Must be one of: {', '.join(valid_display)}"}
    
        # Use title case for API
        api_severity = severity.title()
    
        data = {
            "title": title,
            "test": test_id,
            "severity": api_severity,
            "description": description,
            # Set defaults expected by API if not provided explicitly by user?
            # e.g., "active": True, "verified": False? Check API docs.
            "active": True,
            "verified": False,
        }
    
        # Add optional fields if provided
        if cwe is not None:
            data["cwe"] = cwe
        if cvssv3:
            data["cvssv3"] = cvssv3 # Assuming API accepts the string directly
        if mitigation:
            data["mitigation"] = mitigation
        if impact:
            data["impact"] = impact
        if steps_to_reproduce:
            data["steps_to_reproduce"] = steps_to_reproduce
    
        client = get_client()
        result = await client.create_finding(data)
    
        if "error" in result:
            return {"status": "error", "error": result["error"], "details": result.get("details", "")}
    
        return {"status": "success", "data": result}
  • Registers the 'create_finding' tool with the FastMCP server instance, importing the handler from findings_tools.py.
    mcp.tool(
        name="create_finding",
        description="Create a new finding"
    )(create_finding)
  • The DefectDojoClient method called by the tool handler to perform the actual API POST request to create a finding.
    async def create_finding(self, data: Dict[str, Any]) -> Dict[str, Any]:
        """Create a new finding."""
        return await self._request("POST", "/api/v2/findings/", json=data)
  • Alternative registration of the 'create_finding' tool within the findings_tools module's register_tools function.
    mcp.tool(name="create_finding", description="Create a new finding")(create_finding)
  • Input schema defined by the function type hints and docstring parameters for the create_finding tool.
    async def create_finding(title: str, test_id: int, severity: str, description: str,
                            cwe: Optional[int] = None, cvssv3: Optional[str] = None,
                            mitigation: Optional[str] = None, impact: Optional[str] = None,
                            steps_to_reproduce: Optional[str] = None) -> Dict[str, Any]:
Behavior1/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers none. It doesn't indicate whether this is a write operation, what permissions are required, whether it's idempotent, what happens on success/failure, or any rate limits. The description fails to add value beyond the implied 'create' action.

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

Conciseness2/5

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

While concise with three words, the description is under-specified rather than efficiently informative. It lacks front-loaded critical information and wastes its brevity on stating the obvious. Every sentence should earn its place, but this single phrase adds minimal value beyond the tool name.

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?

Given the complexity (9 parameters, 4 required), no annotations, 0% schema coverage, and presence of an output schema, the description is incomplete. It doesn't address the tool's purpose in context, parameter meanings, or behavioral traits, leaving significant gaps for a mutation tool in a security/finding management domain.

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

Parameters1/5

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

The schema has 9 parameters with 0% description coverage, and the tool description provides no parameter information. It doesn't explain what 'cvssv3', 'cwe', 'severity', or other fields mean, their formats, or constraints (e.g., valid severity values). The description fails to compensate for the schema's lack of documentation.

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

Purpose2/5

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

The description 'Create a new finding' is a tautology that restates the tool name without adding meaningful context. It specifies the verb 'create' and resource 'finding' but lacks specificity about what a 'finding' represents in this domain or how it differs from sibling tools like 'add_finding_note' or 'update_finding_status'.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing test_id or engagement), exclusions, or relationships to sibling tools like 'add_finding_note' (for notes on existing findings) or 'update_finding_status' (for modifying findings).

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

Related 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/jamiesonio/defectdojo-mcp'

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