Skip to main content
Glama
googleSandy

Google Threat Intelligence MCP Server

by googleSandy

get_collection_report

Retrieve a threat collection by its Google Threat Intelligence identifier to access details on malware families, threat actors, campaigns, or 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

  • The main handler for the 'get_collection_report' tool. It uses the @server.tool() decorator to register as an MCP tool, accepts an id, ctx, and optional api_key, and calls utils.fetch_object to retrieve a collection from the Google Threat Intelligence 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
  • The tool is registered via the @server.tool() decorator on the get_collection_report function, where 'server' is a FastMCP instance from gti_mcp/server.py.
    @server.tool()
  • The fetch_object helper function called by get_collection_report. It fetches data from VT API using client.get_object_async with the given collection type ('collections'), id, relationships, and params.
    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
  • COLLECTION_KEY_RELATIONSHIPS and COLLECTION_EXCLUDED_ATTRS: constants that define the schema/configuration used by get_collection_report for fetching related data.
    COLLECTION_KEY_RELATIONSHIPS = [
        "associations",
    ]
    COLLECTION_EXCLUDED_ATTRS = ",".join(["aggregations"])
  • The collections module (which contains get_collection_report) is imported into the tools package, which is loaded by server.py line 73: 'from gti_mcp.tools import *'.
    from .collections import *
    from .files import *
    from .intelligence import *
    from .netloc import *
    from .threat_profiles import *
    from .urls import *
Behavior2/5

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

No annotations are provided, so the description must cover behavioral aspects. It only says 'retrieves', implying a read operation, but does not discuss side effects, authentication needs (beyond the api_key parameter), error behavior, rate limits, or any other consequences. The return object is mentioned but not detailed, though an output schema exists.

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

Conciseness3/5

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

The description is moderately concise but includes some repetitive or tangential information (e.g., the list of collection types). The Args section is brief. It could be more streamlined without losing clarity.

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

Completeness2/5

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

Given that an output schema exists, the description does not need to detail return values, but it should cover the input parameters and usage context. The description lacks details on the api_key parameter and does not explain the tool's role among siblings. The mention of 'collection_type' in the return is helpful but insufficient for complete context.

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 coverage is 0%, so the description must compensate. It lists 'id' as required and mentions 'api_key' in the Args section, but provides no explanation of what these parameters are or how they should be used. The description adds minimal meaning beyond the schema structure.

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 that the tool retrieves a collection by ID. It mentions the context of Google Threat Intelligence and lists example collection types, but the purpose is somewhat muddled by equating 'collections' with 'threats' and mentioning 'report' as a type, which might confuse the tool's name. Overall, it distinguishes itself from sibling get tools by focusing on collections.

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?

No explicit guidance on when to use this tool versus alternatives. The description only explains that threats are modeled as collections and that this tool retrieves them. No comparisons, prerequisites, or exclusion criteria are provided.

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