Skip to main content
Glama
KasperskyLab

Kaspersky OpenTIP MCP Server

Official
by KasperskyLab

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
NameRequiredDescriptionDefault
filenameYes
full_file_pathYes

Implementation Reference

  • 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)}
  • 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,
        ),
    )
  • Endpoint definition for analyze_file tool in the Endpoints enum, mapping to OpenTIP API path 'scan/file'.
    analyze_file = "scan/file"

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/KasperskyLab/threat-intelligence'

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