mark_false_positive
Mark security issues as false positives to filter out non-vulnerabilities from security findings in the ZeroPath MCP Server.
Instructions
Mark a security issue as a false positive (not a real vulnerability).
Args:
issue_id: The ID of the issue to mark as false positive
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_id | Yes |
Implementation Reference
- The @mcp.tool() decorator registers the function as an MCP tool named 'mark_false_positive'. The function implements the tool logic: validates the issue_id parameter, calls the ZeroPath API endpoint 'issues/mark-false-positive', and returns success/error messages based on the API response.@mcp.tool() def mark_false_positive(issue_id: str) -> str: """ Mark a security issue as a false positive (not a real vulnerability). Args: issue_id: The ID of the issue to mark as false positive """ if not issue_id: return "Error: Issue ID is required" response, error = make_api_request( "issues/mark-false-positive", {"issueId": issue_id} ) if error: return error if response.status_code == 200: return f"Issue {issue_id} marked as false positive successfully" 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}"
- src/zeropath_mcp_server/server.py:196-196 (registration)The @mcp.tool() decorator registers the mark_false_positive function as an MCP tool.@mcp.tool()
- Helper function used by mark_false_positive to make authenticated API requests to the ZeroPath endpoint.def make_api_request(endpoint, payload=None, include_org=True): """Make authenticated API request to ZeroPath.""" if not token_id or not token_secret: return None, "Error: Zeropath API credentials not found in environment variables" headers = { "X-ZeroPath-API-Token-Id": token_id, "X-ZeroPath-API-Token-Secret": token_secret, "Content-Type": "application/json" } if payload is None: payload = {} if include_org and org_id: payload["organizationId"] = org_id try: response = requests.post( f"{API_BASE_URL}/{endpoint}", headers=headers, json=payload ) return response, None except Exception as e: return None, f"Error: {str(e)}"