Skip to main content
Glama
googleSandy

Google Threat Intelligence MCP Server

by googleSandy

get_domain_report

Analyze domain security risks using Google Threat Intelligence to detect threats, malware, and suspicious activity for investigation.

Instructions

Get a comprehensive domain analysis report from Google Threat Intelligence.

Args: domain (required): Domain to analyse. Returns: Report with insights about the domain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function for get_domain_report tool. Decorated with @server.tool() to register it as an MCP tool. Fetches domain analysis from Google Threat Intelligence API with key relationships and returns a sanitized report.
    @server.tool()
    async def get_domain_report(domain: str, ctx: Context, api_key: str = None) -> typing.Dict[str, typing.Any]:
      """Get a comprehensive domain analysis report from Google Threat Intelligence.
    
      Args:
        domain (required): Domain to analyse.
      Returns:
        Report with insights about the domain.
      """
      async with vt_client(ctx, api_key=api_key) as client:
        res = await utils.fetch_object(
            client,
            "domains",
            "domain",
            domain,
            relationships=DOMAIN_KEY_RELATIONSHIPS,
            params={"exclude_attributes": "last_analysis_results"})
      return utils.sanitize_response(res)
  • Helper function that fetches objects from Google Threat Intelligence API. Used by get_domain_report to retrieve domain data with specified attributes and relationships.
    async def fetch_object(
        vt_client: vt.Client,
        resource_collection_type: str,
        resource_type: str,
        resource_id: str,
        attributes: list[str] | None = None,
        relationships: list[str] | None = None,
        params: dict[str, typing.Any] | None = None):
      """Fetches objects from Google Threat Intelligence API."""
      logging.info(
          f"Fetching comprehensive {resource_collection_type} "
          f"report for id: {resource_id}")
      
      params = {k: v for k, v in params.items()} if params else {}
    
      # Retrieve a selection of object attributes and/or relationships.
      if attributes:
        params["attributes"] = ",".join(attributes)
      if relationships:
        params["relationships"] = ",".join(relationships)
    
      try:
        obj = await vt_client.get_object_async(
            f"/{resource_collection_type}/{resource_id}", params=params)
    
        if obj.error:
          logging.error(
              f"Error fetching main {resource_type} report for {resource_id}: {obj.error}"
          )
          return {
              "error": f"Failed to get main {resource_type} report: {obj.error}",
              # "details": report.get("details"),
          }
      except vt.error.APIError as e:
        logging.warning(
            f"VirusTotal API Error fetching {resource_type} {resource_id}: {e.code} - {e.message}"
        )
        return {
            "error": f"VirusTotal API Error: {e.code} - {e.message}",
            "details": f"The requested {resource_type} '{resource_id}' could not be found or there was an issue with the API request."
        }
      except Exception as e:
        logging.exception(
            f"Unexpected error fetching {resource_type} {resource_id}: {e}"
        )
        return {"error": "An unexpected internal error occurred."}
    
      # Build response.
      obj_dict = obj.to_dict()
      obj_dict['id'] = obj.id
      if 'aggregations' in obj_dict['attributes']:
        del obj_dict['attributes']['aggregations']
    
      logging.info(
          f"Successfully generated concise threat summary for id: {resource_id}")
      return obj_dict
  • Helper function that recursively removes empty dictionaries and lists from API responses. Used to clean up the domain report before returning it.
    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
  • Async context manager that provides a VirusTotal client instance for API requests. Used by get_domain_report to get a client for fetching domain data.
    @asynccontextmanager
    async def vt_client(ctx: Context, api_key: str = None) -> AsyncIterator[vt.Client]:
      """Provides a vt.Client instance for the current request."""
      client = vt_client_factory(ctx, api_key)
    
      try:
        yield client
      finally:
        await client.close_async()
  • Constant defining which relationships to include in domain reports. Used by get_domain_report to specify which relationships to fetch.
    DOMAIN_KEY_RELATIONSHIPS = [
        "associations",
    ]
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns a 'Report with insights about the domain,' but doesn't mention critical behaviors like authentication requirements (implied by the 'api_key' parameter), rate limits, data freshness, or error handling. For a tool accessing external threat intelligence with an API key, this lack of transparency is a significant gap.

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?

The description is appropriately concise and front-loaded, with the core purpose stated first. The 'Args' and 'Returns' sections are structured clearly, though they could be more integrated. There's no redundant information, but the brevity comes at the cost of completeness in other dimensions.

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's complexity (external API call with authentication), lack of annotations, and an output schema (which should document return values), the description is minimally adequate. It covers the basic purpose and parameters but misses critical context like authentication needs, error cases, and sibling tool differentiation. The output schema reduces the burden, but the description doesn't fully compensate for the missing behavioral details.

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?

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description adds minimal value: it notes 'domain (required): Domain to analyse' and 'Returns: Report with insights about the domain,' but doesn't explain the 'api_key' parameter's purpose, format, or necessity. It partially compensates for the coverage gap but leaves key parameter semantics unclear.

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 a comprehensive domain analysis report from Google Threat Intelligence.' It specifies the verb ('Get'), resource ('domain analysis report'), and source ('Google Threat Intelligence'), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_url_report' or 'get_ip_address_report', which likely perform similar analyses on different resource types.

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. While it mentions 'domain analysis,' it doesn't clarify if this is for threat intelligence, security assessments, or other contexts, nor does it reference sibling tools like 'get_entities_related_to_a_domain' or 'search_iocs' that might overlap in functionality. Usage is implied but not explicitly defined.

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