Skip to main content
Glama
googleSandy

Google Threat Intelligence MCP Server

by googleSandy

get_collection_report

Retrieve threat intelligence collections from Google's platform to analyze malware families, threat actors, campaigns, and security reports.

Instructions

At Google Threat Intelligence, threats are modeled as "collections". This tool retrieves them from the platform.

They have different collections types like:

  • "malware-family"

  • "threat-actor"

  • "campaign"

  • "report"

  • "collection".

You can find the collection type in the "collection_type" field.

Args: id (required): Google Threat Intelligence identifier. Returns: A collection object. Put attention to the collection type to correctly understand what it represents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function for get_collection_report tool. Uses @server.tool() decorator for registration and calls utils.fetch_object to retrieve collection data from the API.
    @server.tool()
    async def get_collection_report(id: str, ctx: Context, api_key: str = None) -> typing.Dict[str, typing.Any]:
      """At Google Threat Intelligence, threats are modeled as "collections". This tool retrieves them from the platform.
    
      They have different collections types like: 
        - "malware-family"
        - "threat-actor"
        - "campaign"
        - "report"
        - "collection". 
    
      You can find the collection type in the "collection_type" field.
    
      Args:
        id (required): Google Threat Intelligence identifier.
      Returns:
        A collection object. Put attention to the collection type to correctly understand what it represents.
      """
      async with vt_client(ctx, api_key=api_key) as client:
        res = await utils.fetch_object(
            client,
            "collections",
            "collection",
            id,
            relationships=COLLECTION_KEY_RELATIONSHIPS,
            params={"exclude_attributes": COLLECTION_EXCLUDED_ATTRS})
      return res
  • Helper utility function that performs the actual API call to fetch collection data from VirusTotal. Handles API errors and processes the response.
    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
  • The @server.tool() decorator registers the get_collection_report function as an MCP tool in the server.
    @server.tool()
  • Schema constants defining valid collection types, relationships, and excluded attributes used by get_collection_report and other collection-related tools.
    COLLECTION_RELATIONSHIPS = [
        "associations",
        "attack_techniques",
        "domains",
        "files",
        "ip_addresses",
        "urls",
        "threat_actors",
        "malware_families",
        "software_toolkits",
        "campaigns",
        "vulnerabilities",
        "reports",
        "suspected_threat_actors",
        "hunting_rulesets",
    ]
    
    COLLECTION_KEY_RELATIONSHIPS = [
        "associations",
    ]
    COLLECTION_EXCLUDED_ATTRS = ",".join(["aggregations"])
Behavior2/5

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

No annotations are provided, so the description carries full burden. It discloses that the tool retrieves data (read-only behavior) and mentions collection types, but lacks critical details: authentication requirements (api_key parameter), rate limits, error handling, or what 'retrieves' entails (e.g., format, pagination). For a tool with no annotations, this is insufficient behavioral context.

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 sized and front-loaded with the core purpose. The bullet list of collection types is useful, and the Args/Returns sections add structure. However, the first sentence could be more direct, and some phrasing ('Put attention') is slightly verbose. Overall, it's efficient with minimal waste.

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 moderate complexity (retrieval with 2 parameters), no annotations, and an output schema exists (so return values needn't be detailed), the description is mostly complete. It covers purpose, parameter semantics for the key 'id', and output context. The main gap is missing details on the 'api_key' parameter and behavioral traits like authentication, but the output schema reduces burden.

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 description coverage is 0%, so the description must compensate. It explains the 'id' parameter as a 'Google Threat Intelligence identifier' and implies it's required, adding meaning beyond the schema. However, it omits the 'api_key' parameter entirely, leaving a gap. Since only 1 of 2 parameters is covered, but the covered one is critical, a score of 4 reflects good but incomplete compensation.

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 'retrieves' collections from the Google Threat Intelligence platform, specifying the resource (collections) and context (threat modeling). It distinguishes from siblings like 'create_collection' (write vs read) and 'get_collection_feature_matches' (specific features vs full object), though not all sibling differences are explicit. The purpose is specific but could better contrast with similar retrieval tools.

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?

Usage is implied by the description: use this tool to retrieve a collection when you have its ID. It mentions checking the 'collection_type' field to understand the collection, but provides no explicit guidance on when to choose this over alternatives like 'get_threat_profile' or 'search_threats'. No exclusions or prerequisites are stated, leaving gaps in decision-making.

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