Skip to main content
Glama

adv_unmark_false_positive

Remove false positive markings from findings in .adversary.json files to ensure accurate security insights during software development.

Instructions

Remove false positive marking from a finding in the .adversary.json file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
finding_uuidYesUUID of the finding to unmark
pathNoPath to directory containing .adversary.json or direct path to .adversary.json file.

Implementation Reference

  • The MCP tool handler for 'adv_unmark_false_positive'. Validates input arguments, initializes FalsePositiveJsonRepository and FalsePositiveService, calls service.unmark_false_positive(), and returns JSON success response.
    async def _handle_unmark_false_positive( self, name: str, arguments: dict ) -> list[types.TextContent]: """Handle unmark false positive requests.""" try: # Comprehensive input validation validated_args = self._input_validator.validate_mcp_arguments( arguments, tool_name="adv_unmark_false_positive" ) finding_uuid = validated_args.get("finding_uuid", "") adversary_file_path = validated_args.get( "adversary_file_path", ".adversary.json" ) if not finding_uuid: raise CleanAdversaryToolError("finding_uuid parameter is required") # Initialize false positive repository and service fp_repository = FalsePositiveJsonRepository(adversary_file_path) fp_service = FalsePositiveService(fp_repository) # Unmark false positive success = await fp_service.unmark_false_positive(finding_uuid) result = { "success": success, "finding_uuid": finding_uuid, "message": ( f"Finding {finding_uuid} unmarked as false positive" if success else f"Failed to unmark finding {finding_uuid} as false positive" ), } return [types.TextContent(type="text", text=json.dumps(result, indent=2))] except Exception as e: logger.error(f"Unmark false positive failed: {e}") raise CleanAdversaryToolError(f"Unmark false positive failed: {str(e)}")
  • Tool dispatcher registration in _register_tools() method. Maps 'adv_unmark_false_positive' to the handler function.
    @self.server.call_tool() async def tool_dispatcher( name: str, arguments: dict ) -> list[types.TextContent]: """Dispatch MCP tool calls to the appropriate handler.""" if name == "adv_scan_file": return await self._handle_scan_file(name, arguments) elif name == "adv_scan_folder": return await self._handle_scan_folder(name, arguments) elif name == "adv_scan_code": return await self._handle_scan_code(name, arguments) elif name == "adv_get_status": return await self._handle_get_status(name, arguments) elif name == "adv_get_version": return await self._handle_get_version(name, arguments) elif name == "adv_mark_false_positive": return await self._handle_mark_false_positive(name, arguments) elif name == "adv_unmark_false_positive": return await self._handle_unmark_false_positive(name, arguments) else: raise ValueError(f"Unknown tool: {name}")
  • Input schema definition for the 'adv_unmark_false_positive' tool in get_tools() method, defining required 'finding_uuid' and optional 'adversary_file_path'.
    name="adv_unmark_false_positive", description="Remove false positive marking from a finding", inputSchema={ "type": "object", "properties": { "finding_uuid": { "type": "string", "description": "UUID of the finding to unmark", }, "adversary_file_path": { "type": "string", "description": "Path to .adversary.json file", "default": ".adversary.json", }, }, "required": ["finding_uuid"], }, ),
  • Core business logic in FalsePositiveService.unmark_false_positive(). Validates UUID, checks if marked, removes via repository, returns success boolean.
    async def unmark_false_positive(self, uuid: str) -> bool: """ Remove false positive marking from a finding. Args: uuid: UUID of the finding to unmark Returns: True if unmarked successfully, False otherwise """ try: # Validate input if not uuid.strip(): raise ValueError("UUID cannot be empty") # Check if it exists and is marked as false positive existing_info = await self.repository.get_false_positive_info(uuid) if not existing_info or not existing_info.is_false_positive: self.logger.warning(f"Finding {uuid} is not marked as false positive") return False # Remove false positive marking success = await self.repository.remove_false_positive_info(uuid) if success: self.logger.info(f"Unmarked finding {uuid} as false positive") else: self.logger.error(f"Failed to unmark finding {uuid} as false positive") return success except Exception as e: self.logger.error(f"Error unmarking finding {uuid} as false positive: {e}") return False

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/brettbergin/adversary-mcp-server'

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