analyze_file
Submit files for security analysis to detect threats using Kaspersky's OpenTIP API. This tool scans files for malicious content and provides basic threat assessment results.
Instructions
Submit a file for basic analysis using the OpenTIP API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| full_file_path | Yes |
Implementation Reference
- opentip-mcp/opentip.py:192-223 (handler)The MCP tool handler for 'analyze_file', decorated with @mcp.tool for registration. It reads the local file and POSTs it to the OpenTIP 'scan/file' endpoint for analysis, returning results or error.@mcp.tool( description="Submit a file for basic analysis using the OpenTIP API.", annotations=ToolAnnotations( title="Analyze a file by uploading it", readOnlyHint=False, openWorldHint=True, ), ) async def analyze_file(filename: str, full_file_path: str) -> dict[str, Any] | None: """Submit a file for basic analysis using the OpenTIP API. Args: filename: The name of the file to analyze. full_file_path: The full path to the file on the local system. """ params = {"filename": filename} headers = { "Content-Type": "application/octet-stream", } try: with open(full_file_path, "rb") as f: file_data = f.read() return await opentip_request( endpoint=Endpoints.analyze_file, request_type="post", params=params, content=file_data, headers=headers, ) except Exception as e: # noqa return {"result": "error", "error_message": str(e)}
- opentip-mcp/opentip.py:192-199 (registration)The @mcp.tool decorator registers the 'analyze_file' tool with description and annotations defining input schema and behavior hints.@mcp.tool( description="Submit a file for basic analysis using the OpenTIP API.", annotations=ToolAnnotations( title="Analyze a file by uploading it", readOnlyHint=False, openWorldHint=True, ), )
- opentip-mcp/opentip.py:49-49 (helper)Endpoint definition for analyze_file tool in the Endpoints enum, mapping to OpenTIP API path 'scan/file'.analyze_file = "scan/file"