Skip to main content
Glama
googleSandy

Google Threat Intelligence MCP Server

by googleSandy

get_entities_related_to_an_ip_address

Retrieve entities associated with an IP address, including campaigns, malware families, URLs, and more. Supports multiple relationship types for threat intelligence enrichment.

Instructions

Retrieve entities related to the the given IP Address.

The following table shows a summary of available relationships for IP Address objects.

Relationship

Description

Return type

associations

IP's associated objects (reports, campaigns, IoC collections, malware families, software toolkits, vulnerabilities, threat-actors), without filtering by the associated object type.

collection

campaigns

Campaigns associated to the IP address.

collection

collections

IoC Collections associated to the IP address.

collection

comments

Comments for the IP address.

comment

communicating_files

Files that communicate with the IP address.

file

downloaded_files

Files downloaded from the IP address.

file

graphs

Graphs including the IP address.

graph

historical_ssl_certificates

SSL certificates associated with the IP.

ssl-cert

historical_whois

WHOIS information for the IP address.

whois

malware_families

Malware families associated to the IP address.

collection

memory_pattern_parents

Files having an IP as string on memory during sandbox execution.

file

referrer_files

Files containing the IP address.

file

related_comments

Community posted comments in the IP's related objects.

comment

related_reports

Reports that are directly and indirectly related to the IP.

collection

related_threat_actors

Threat actors related to the IP address.

collection

reports

Reports directly associated to the IP.

collection

resolutions

IP address' resolutions

resolution

software_toolkits

Software and Toolkits associated to the IP address.

collection

urls

URLs related to the IP address.

url

user_votes

IP's votes made by current signed-in user.

vote

votes

IP's votes.

vote

vulnerabilities

Vulnerabilities associated to the IP address.

collection

Args: ip_address (required): IP Addres to analyse. relationship_name (required): Relationship name. descriptors_only (required): Bool. Must be True when the target object type is one of file, domain, url, ip_address or collection. limit: Limit the number of entities to retrieve. 10 by default. Returns: List of entities related to the IP Address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ip_addressYes
relationship_nameYes
descriptors_onlyYes
limitNo
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_entities_related_to_an_ip_address' tool. It validates the relationship_name against IP_RELATIONSHIPS, fetches related entities using utils.fetch_object_relationships, and returns sanitized results.
    @server.tool()
    async def get_entities_related_to_an_ip_address(
        ip_address: str, relationship_name: str, descriptors_only: bool, ctx: Context, limit: int = 10, api_key: str = None
    ) -> list[dict[str, typing.Any]]:
      """Retrieve entities related to the the given IP Address.
    
        The following table shows a summary of available relationships for IP Address objects.
    
        | Relationship                | Description                                            | Return type  |
        | --------------------------- | ------------------------------------------------------ | ------------ |
        | associations                | IP's associated objects (reports, campaigns, IoC collections, malware families, software toolkits, vulnerabilities, threat-actors), without filtering by the associated object type. | collection |
        | campaigns                   | Campaigns associated to the IP address.                | collection   |
        | collections                 | IoC Collections associated to the IP address.          | collection   |
        | comments                    | Comments for the IP address.                           | comment      |
        | communicating_files         | Files that communicate with the IP address.            | file         |
        | downloaded_files            | Files downloaded from the IP address.                  | file         |
        | graphs                      | Graphs including the IP address.                       | graph        |
        | historical_ssl_certificates | SSL certificates associated with the IP.               | ssl-cert     |
        | historical_whois            | WHOIS information for the IP address.                  | whois        |
        | malware_families            | Malware families associated to the IP address.         | collection   |
        | memory_pattern_parents      | Files having an IP as string on memory during sandbox execution. | file |
        | referrer_files              | Files containing the IP address.                       | file         |
        | related_comments            | Community posted comments in the IP's related objects. | comment      |
        | related_reports             | Reports that are directly and indirectly related to the IP. | collection |
        | related_threat_actors       | Threat actors related to the IP address.               | collection   |
        | reports                     | Reports directly associated to the IP.                 | collection   |
        | resolutions                 | IP address' resolutions                                | resolution   |
        | software_toolkits           | Software and Toolkits associated to the IP address.    | collection   |
        | urls                        | URLs related to the IP address.                        | url          |
        | user_votes                  | IP's votes made by current signed-in user.             | vote         |
        | votes                       | IP's votes.                                            | vote         |
        | vulnerabilities             | Vulnerabilities associated to the IP address.          | collection   |
    
        Args:
          ip_address (required): IP Addres to analyse.
          relationship_name (required): Relationship name.
          descriptors_only (required): Bool. Must be True when the target object type is one of file, domain, url, ip_address or collection.
          limit: Limit the number of entities to retrieve. 10 by default.
        Returns:
          List of entities related to the IP Address.
      """
      if not relationship_name in IP_RELATIONSHIPS:
        return {
           "error": f"Relationship {relationship_name} does not exist. "
                    f"Available relationships are: {','.join(IP_RELATIONSHIPS)}"
        }
    
      async with vt_client(ctx) as client:
        res = await utils.fetch_object_relationships(
            client, 
            "ip_addresses",
            ip_address,
            relationships=[relationship_name],
            descriptors_only=descriptors_only,
            limit=limit)
      return utils.sanitize_response(res.get(relationship_name, []))
  • IP_RELATIONSHIPS list defines valid relationship names for the IP address tool, used for input validation in the handler.
    IP_RELATIONSHIPS = [
        "associations",
        "campaigns",
        "collections",
        "comments",
        "communicating_files",
        "downloaded_files",
        "graphs",
        "historical_ssl_certificates",
        "historical_whois",
        "malware_families",
        "memory_pattern_parents",
        "referrer_files",
        "related_comments",
        "related_reports",
        "related_threat_actors",
        "reports",
        "resolutions",
        "software_toolkits",
        "urls",
        "user_votes",
        "votes",
        "vulnerabilities",
    ]
  • The FastMCP server is instantiated and then tools are loaded via 'from gti_mcp.tools import *', which includes netloc.py where the tool is registered with the @server.tool() decorator.
    # Create a named server and specify dependencies for deployment and development
    server = FastMCP(
        "Google Threat Intelligence MCP server",
        dependencies=["vt-py"],
        stateless_http=stateless)
    
    # Load tools.
    from gti_mcp.tools import *
  • The fetch_object_relationships helper function used by the tool to fetch relationship data from the VT API.
    async def fetch_object_relationships(
        vt_client: vt.Client,
        resource_collection_type: str,
        resource_id: str,
        relationships: typing.List[str],
        params: dict[str, typing.Any] | None = None,
        descriptors_only: bool = True,
        limit: int = 10):
      """Fetches the given relationships descriptors from the given object."""
      rel_futures = {}
      # If true, returns descriptors instead of full objects.
      descriptors = '/relationship' if descriptors_only else ''
      async with asyncio.TaskGroup() as tg:
        for rel_name in relationships:
          rel_futures[rel_name] = tg.create_task(
              consume_vt_iterator(
                  vt_client,
                  f"/{resource_collection_type}/{resource_id}"
                  f"{descriptors}/{rel_name}", params=params, limit=limit))
    
      data = {}
      for name, items in rel_futures.items():
        data[name] = []
        for obj in items.result():
          obj_dict = obj.to_dict()
          if 'aggregations' in obj_dict['attributes']:
            del obj_dict['attributes']['aggregations']
          data[name].append(obj_dict)
    
      return data
  • The sanitize_response helper function used to clean up the returned data by removing empty dicts/lists.
    def sanitize_response(data: typing.Any) -> typing.Any:
      """Removes empty dictionaries and lists recursively from a response."""
      if isinstance(data, dict):
        sanitized_dict = {}
        for key, value in data.items():
          sanitized_value = sanitize_response(value)
          if sanitized_value is not None:
            sanitized_dict[key] = sanitized_value
        return sanitized_dict
      elif isinstance(data, list):
        sanitized_list = []
        for item in data:
          sanitized_item = sanitize_response(item)
          if sanitized_item is not None:
            sanitized_list.append(sanitized_item)
        return sanitized_list
      elif isinstance(data, str):
        return data if data else None
      else:
        return data
Behavior3/5

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

No annotations provided; description explains the descriptors_only constraint and default limit. However, it does not disclose authentication needs, rate limits, or that it's a read operation.

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

Conciseness4/5

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

Front-loaded with a clear purpose; the relationship table is informative but lengthy. Could be more concise, but the structure is logical.

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?

Covers relationship options and parameters well, with output schema covering return values. Missing explanation for api_key and pagination/error handling, but overall adequate.

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

Parameters4/5

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

Schema has 0% description coverage, but the description explains ip_address, relationship_name, descriptors_only (with a usage note), and limit. However, api_key is not mentioned.

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

Purpose5/5

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

Clearly states the tool retrieves entities related to an IP address. The detailed table of relationships distinguishes it from sibling tools for other entity types.

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

Usage Guidelines4/5

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

Assumes user has an IP address; sibling tools are for other entity types, so context is clear. No explicit when-not or alternatives mentioned, but the relationship table guides selection.

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/googleSandy/gti-mcp-standalone'

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