Skip to main content
Glama
googleSandy

Google Threat Intelligence MCP Server

by googleSandy

get_collections_commonalities

Identify shared attributes and relationships among indicators of compromise (IoCs) within a threat collection to analyze patterns and connections in cybersecurity investigations.

Instructions

Retrieve the common characteristics or features (attributes / relationships) of the indicators of compromise (IoC) within a collection, identified by its ID. Args: collection_id (required): Collection identifier. Returns: Markdown-formatted string with the commonalities of the collection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idYes
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function for get_collections_commonalities tool. This async function retrieves common characteristics or features of indicators of compromise (IoC) within a collection by calling the VirusTotal API endpoint /collections/{collection_id}?attributes=aggregations and returns a markdown-formatted string of the commonalities.
    @server.tool()
    async def get_collections_commonalities(collection_id: str, ctx: Context, api_key: str = None) -> str:
      """Retrieve the common characteristics or features (attributes / relationships) of the indicators of compromise (IoC) within a collection, identified by its ID.
      Args:
        collection_id (required): Collection identifier.
      Returns:
        Markdown-formatted string with the commonalities of the collection.
      """
      async with vt_client(ctx, api_key=api_key) as client:
        data = await client.get_async(f"/collections/{collection_id}?attributes=aggregations")
        data = await data.json_async()
        sanitized_data = utils.sanitize_response(data["data"])
        markdown_output = utils.parse_collection_commonalities(sanitized_data)
      return markdown_output
  • Tool registration via @server.tool() decorator at line 647, which registers get_collections_commonalities as an available MCP tool.
    @server.tool()
  • Helper function parse_collection_commonalities that converts the aggregations data from the API response into a formatted markdown string. It iterates through IOC types and their features, formatting counts, values, and prevalence information into a readable markdown format.
    def parse_collection_commonalities(data: dict) -> str:
        """
        Converts a dictionary from a JSON file to a markdown string.
        """
        markdown_string = ""
        collection_id = data.get("id", "N/A")
        markdown_string += f"# Commonalities for {collection_id}\n\n"
    
        aggregations = data.get("attributes", {}).get("aggregations", {})
        for ioc_type, features in aggregations.items():
            # Replace underscores in ioc_type
            formatted_ioc_type = ioc_type.replace('_', ' ')
            markdown_string += f"## {formatted_ioc_type} commonalities\n\n"
            
            for feature_type, feature_list in features.items():
                if isinstance(feature_list, list):
                    # Replace underscores in feature_type
                    formatted_feature_type = feature_type.replace('_', ' ')
                    markdown_string += f"### {formatted_feature_type}\n"
                    
                    for item in feature_list:
                        value = item.get("value", "N/A")
                        if isinstance(value, dict):
                            value = value.get("id", "N/A")
                        count = item.get("count", "N/A")
                        prevalence = item.get("prevalence", "N/A")
                        
                        if prevalence != "N/A" and float(prevalence) != 0:
                            markdown_string += f"- {count} matches of {value} with a prevalence of {prevalence:.8g}\n"
                        else:
                            markdown_string += f"- {count} matches of {value}\n"
                    markdown_string += "\n"
    
        return markdown_string
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 states it retrieves commonalities and returns a markdown string, but lacks details on permissions, rate limits, error handling, or what 'common characteristics' entail (e.g., statistical summaries, patterns). For a tool with no annotations, this is insufficient.

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 front-loaded with the core purpose, followed by Args and Returns sections. It's efficient with minimal waste, though the structure could be more integrated (e.g., combining description with parameter details).

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 no annotations, 2 parameters with 0% schema coverage, and an output schema (implied by 'Returns'), the description is moderately complete. It covers purpose and return format but lacks behavioral context and full parameter details, making it adequate but with clear gaps for a retrieval tool.

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 description must compensate. It mentions 'collection_id' as required and describes it as a 'Collection identifier', which adds basic meaning. However, it doesn't explain 'api_key' or provide format examples, leaving gaps for 2 parameters with low coverage.

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 verb 'retrieve' and the resource 'common characteristics or features of IoCs within a collection', specifying it's about indicators of compromise. It doesn't explicitly differentiate from siblings like 'get_collection_feature_matches' or 'get_collection_report', but the focus on 'commonalities' provides some distinction.

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 guidance is provided on when to use this tool versus alternatives. With many sibling tools like 'get_collection_feature_matches' and 'get_collection_report', the description lacks context for selection, such as comparing commonalities vs. specific features or reports.

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