Skip to main content
Glama
KasperskyLab

Kaspersky OpenTIP MCP Server

Official
by KasperskyLab

search_ip

Read-only

Check IP addresses for security threats using Kaspersky's threat intelligence database to identify malicious activity and assess risk.

Instructions

Get threat intelligence data about an IP address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'search_ip' tool. Validates the input IP address using a regex pattern and makes an asynchronous GET request to the OpenTIP API endpoint for IP search, returning threat intelligence data or an error.
    async def search_ip(ip: str) -> dict[str, Any] | None:
        """Get threat intelligence data about an IP address
    
        Args:
            ip: IPv4 address that you want to investigate
        """
    
        if not ip_pattern.match(ip):
            return {"result": "error", "error_message": "Invalid IP address format. Please provide a valid IPv4 address."}
    
        params = {"request": ip}
        return await opentip_request(Endpoints.search_ip, "get", params)
  • Registers the 'search_ip' tool with the FastMCP server using the @mcp.tool decorator, providing a description and ToolAnnotations for metadata.
    @mcp.tool(
        description="Get threat intelligence data about an IP address",
        annotations=ToolAnnotations(
            title="Investigate an IP",
            readOnlyHint=True,
            openWorldHint=True,
        ),
    )
  • Defines the regex pattern for validating IPv4 addresses, used in the search_ip handler for input validation.
    ip_pattern = re.compile(r'^(\d{1,3}\.){3}\d{1,3}$')
  • StrEnum defining API endpoints, including 'search_ip' used by the handler to construct the API URL.
    class Endpoints(StrEnum):
        search_hash = "search/hash"
        search_ip = "search/ip"
        search_domain = "search/domain"
        search_url = "search/url"
        analyze_file = "scan/file"
        get_analysis_results = "getresult/file"
Behavior3/5

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

Annotations provide readOnlyHint=true and openWorldHint=true, indicating it's a safe read operation with open-world data. The description adds value by specifying 'threat intelligence data,' which gives context on the type of information returned, but it doesn't disclose additional behavioral traits like rate limits, authentication needs, or data sources. With annotations covering safety, a baseline score is appropriate.

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: 'Get threat intelligence data about an IP address.' It's front-loaded with the core purpose, has zero wasted words, and is appropriately sized for the tool's simplicity. Every part of the sentence earns its place by clearly conveying the tool's function.

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

Completeness4/5

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

Given the tool's low complexity (1 parameter, no nested objects) and the presence of annotations (readOnlyHint, openWorldHint) and an output schema, the description is reasonably complete. It specifies the tool's purpose and data type, though it could benefit from more usage guidance or parameter details. The output schema likely covers return values, reducing the need for description elaboration.

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

Parameters3/5

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

The input schema has 1 parameter ('ip') with 0% description coverage, meaning the schema lacks parameter details. The description doesn't add any parameter-specific information beyond implying the IP is for threat intelligence. Since schema coverage is low, the description partially compensates by hinting at the parameter's purpose, but it doesn't provide syntax or format details, aligning with the baseline.

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 tool's purpose: 'Get threat intelligence data about an IP address.' It specifies the verb ('get') and resource ('threat intelligence data about an IP address'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'search_domain' or 'search_hash' beyond the IP focus, preventing a perfect score.

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

Usage Guidelines3/5

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

The description implies usage context by mentioning 'threat intelligence data,' suggesting it's for security investigations. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., 'search_domain' for domains) or any prerequisites. The implied context is helpful but not comprehensive enough for higher scores.

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