Skip to main content
Glama
KasperskyLab

Kaspersky OpenTIP MCP Server

Official
by KasperskyLab

analyze_file

Submit files for security analysis to detect potential threats using Kaspersky's OpenTIP API. This tool provides basic file scanning to identify malicious content and security risks.

Instructions

Submit a file for basic analysis using the OpenTIP API.

Input Schema

NameRequiredDescriptionDefault
filenameYes
full_file_pathYes

Input Schema (JSON Schema)

{ "properties": { "filename": { "title": "Filename", "type": "string" }, "full_file_path": { "title": "Full File Path", "type": "string" } }, "required": [ "filename", "full_file_path" ], "type": "object" }

Implementation Reference

  • Registers the analyze_file tool with the FastMCP server using the @mcp.tool decorator, including metadata like description and ToolAnnotations.
    @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, ), )
  • The core handler function for the analyze_file tool. It reads the specified file, prepares the request with filename param and octet-stream content, and calls opentip_request to POST to the scan/file endpoint.
    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)}
  • Defines the API endpoint string 'scan/file' for the analyze_file tool within the Endpoints enum.
    analyze_file = "scan/file"
  • Function signature and docstring defining the input schema (filename: str, full_file_path: str) and output (dict[str, Any] | None).
    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. """

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