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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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"
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate readOnlyHint=false (implying mutation) and openWorldHint=true (suggests external API call), which the description doesn't explicitly address. The description adds context about 'uploading' (implied by 'Submit a file') and using an external API ('OpenTIP API'), but doesn't detail behavioral traits like rate limits, authentication needs, or what 'basic analysis' entails beyond what annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('Submit a file for basic analysis') without unnecessary words. Every part earns its place by specifying the resource and API context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has annotations (readOnlyHint=false, openWorldHint=true) and an output schema (which handles return values), the description is minimally adequate. However, it lacks details on usage context, parameter meanings, and behavioral nuances like what 'basic analysis' includes or how it differs from siblings, leaving gaps in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries full burden for parameter meaning. It mentions 'Submit a file' but doesn't explain the two parameters (filename and full_file_path), their relationship, or why both are required. No additional semantics are provided beyond the bare schema, failing to compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Submit a file for basic analysis') and resource ('using the OpenTIP API'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'get_full_analysis_result' or 'search_hash', which might also involve file analysis but with different approaches or scopes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_full_analysis_result' (which might retrieve results) or other search tools. It mentions 'basic analysis' but doesn't clarify what constitutes basic versus advanced or when to choose this over other analysis methods.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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