save_partial_finding
Saves partial penetration testing findings like open ports and protocols for later analysis when data is too long or already exists elsewhere.
Instructions
save partial findings for later use (like open ports, used protocols, versions etc.) if finding data is too long or already exists in another file dont save it
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| content | Yes |
Implementation Reference
- src/pentestmcp/server.py:123-132 (handler)The handler function decorated with @mcp.tool for the 'save_partial_finding' tool. It creates the project directory if it doesn't exist and uses the save_file helper to write the provided content to the specified filename in the project directory.@mcp.tool(name="save_partial_finding",description="save partial findings for later use (like open ports, used protocols, versions etc.) if finding data is too long or already exists in another file dont save it") def save_partial_finding(filename: str,content: str): os.makedirs(config.PROJECT_DIRECTORY, exist_ok=True) save_file(config.PROJECT_DIRECTORY, filename, content)
- src/pentestmcp/server.py:89-113 (helper)Helper function used by save_partial_finding to save content to a file in the specified directory, with validation and error handling.def save_file(directory: str, filename: str, content: str) -> bool: try: if not directory or not filename: raise ValueError("Directory and filename cannot be empty") if not isinstance(content, str): raise ValueError("Content must be a string") dir_path = Path(directory) dir_path.mkdir(parents=True, exist_ok=True) file_path = dir_path / filename with open(file_path, 'w', encoding='utf-8') as file: file.write(content) print(f"File saved successfully: {file_path}") return True except Exception as e: print(f"Error saving file: {str(e)}") return False
- src/pentestmcp/server.py:123-123 (registration)The @mcp.tool decorator registers the save_partial_finding function as an MCP tool.@mcp.tool(name="save_partial_finding",description="save partial findings for later use (like open ports, used protocols, versions etc.) if finding data is too long or already exists in another file dont save it")