Skip to main content
Glama
googleSandy

Google Threat Intelligence MCP Server

by googleSandy

get_collection_mitre_tree

Retrieve MITRE ATT&CK tactics and techniques for threat analysis to understand attack patterns and improve security response.

Instructions

Retrieves the Mitre tactics and techniques associated with a threat.

Args: id (required): Collection identifiers. Return: A dictionary including the tactics and techniques associated to the given threat.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The complete implementation of get_collection_mitre_tree tool. This function retrieves MITRE tactics and techniques associated with a collection from the Google Threat Intelligence API. It includes the @server.tool() decorator for registration and handles API errors gracefully by returning error dictionaries.
    @server.tool()
    async def get_collection_mitre_tree(id: str, ctx: Context, api_key: str = None) -> typing.Dict:
      """Retrieves the Mitre tactics and techniques associated with a threat.
    
      Args:
        id (required): Collection identifiers.
      Return:
        A dictionary including the tactics and techniques associated to the given threat.
      """
      async with vt_client(ctx, api_key=api_key) as client:
        resp = await client.get_async(f"/collections/{id}/mitre_tree")
        if resp.status != 200:
            error_json = await resp.json_async()
            error_info = error_json.get("error", {})
            return {"error": f"API Error: {error_info.get('message', 'Unknown error')}"}
        data = await resp.json_async()
      return utils.sanitize_response(data.get("data", {}))
  • Function signature with type hints defining input/output schema: takes an id (str), ctx (Context), and optional api_key (str), returns typing.Dict. This serves as the type definition for the tool's interface.
    async def get_collection_mitre_tree(id: str, ctx: Context, api_key: str = None) -> typing.Dict:
      """Retrieves the Mitre tactics and techniques associated with a threat.
    
      Args:
        id (required): Collection identifiers.
      Return:
        A dictionary including the tactics and techniques associated to the given threat.
      """
      async with vt_client(ctx, api_key=api_key) as client:
        resp = await client.get_async(f"/collections/{id}/mitre_tree")
        if resp.status != 200:
            error_json = await resp.json_async()
            error_info = error_json.get("error", {})
            return {"error": f"API Error: {error_info.get('message', 'Unknown error')}"}
        data = await resp.json_async()
      return utils.sanitize_response(data.get("data", {}))
  • The sanitize_response helper function used by get_collection_mitre_tree to clean API responses by removing empty dictionaries and lists recursively.
    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
  • FastMCP server instance creation and tool loading. The server object is used by @server.tool() decorators to register tools, and line 73 imports all tools from gti_mcp.tools module.
    server = FastMCP(
        "Google Threat Intelligence MCP server",
        dependencies=["vt-py"],
        stateless_http=stateless)
    
    # Load tools.
    from gti_mcp.tools import *
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. It states 'retrieves', implying a read-only operation, but does not disclose behavioral traits such as authentication needs (e.g., api_key usage), rate limits, error handling, or what 'associated to the given threat' entails in practice. This leaves significant gaps for safe and effective tool invocation.

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 with a clear purpose statement followed by arg and return sections. It avoids unnecessary fluff, though the structure could be more front-loaded by integrating parameter hints into the main description for quicker scanning.

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, 0% schema coverage, but an output schema exists, the description is partially complete. It covers the basic purpose and one parameter, but misses key behavioral context and half the parameters. The output schema reduces the need to explain return values, but overall, it's inadequate for a tool with undocumented parameters and no safety disclosures.

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 'id (required): Collection identifiers' and implies it's for a threat, adding some meaning beyond the schema's generic 'Id' title. However, it does not explain the 'api_key' parameter at all, leaving half of the parameters undocumented, which is inadequate given the 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 'retrieves' and the resource 'Mitre tactics and techniques associated with a threat', which is specific and actionable. However, it does not explicitly differentiate from sibling tools like 'get_threat_profile' or 'get_collection_report', which might also retrieve threat-related information, so it misses full sibling differentiation.

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. With many sibling tools like 'get_threat_profile' or 'get_collection_report', there is no indication of context, prerequisites, or exclusions, leaving the agent to guess based on tool names alone.

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