Skip to main content
Glama
googleSandy

Google Threat Intelligence MCP Server

by googleSandy

get_file_behavior_summary

Retrieve sandbox behavior reports for files using hash identifiers to analyze potential threats and malware activities.

Instructions

Retrieve a summary of all the file behavior reports from all the sandboxes.

Args: hash (required): MD5/SHA1/SHA256) hash that identifies the file. Returns: The file behavior summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYes
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function for get_file_behavior_summary tool. Retrieves file behavior summary from VirusTotal API, handles API errors and unexpected response formats, and returns sanitized data.
    @server.tool()
    async def get_file_behavior_summary(hash: str, ctx: Context, api_key: str = None) -> typing.Dict[str, typing.Any]:
      """Retrieve a summary of all the file behavior reports from all the sandboxes.
    
      Args:
        hash (required): MD5/SHA1/SHA256) hash that identifies the file.
      Returns:
        The file behavior summary.
      """
      async with vt_client(ctx, api_key=api_key) as client:
        res = await client.get_async(f"/files/{hash}/behaviour_summary")
        res = await res.json_async()
    
      if "data" not in res:
          if "error" in res:
              logging.warning(f"VirusTotal API Error: {res['error']}")
              return {"error": f"VirusTotal API Error: {res['error']}"}
          logging.warning(f"Unexpected response format from VirusTotal API: {res}")
          return {"error": f"Unexpected response format from VirusTotal API: {res}"}
    
      return utils.sanitize_response(res["data"])
  • Tool registration using @server.tool() decorator that registers get_file_behavior_summary as an MCP tool with the FastMCP server.
    @server.tool()
  • Helper function sanitize_response that recursively removes empty dictionaries and lists from the response data before returning to the client.
    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 vt_client that provides a vt.Client instance for API calls and ensures proper cleanup by closing the client after use.
    @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()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a retrieval operation, implying it's likely read-only, but doesn't mention authentication needs (despite an 'api_key' parameter in the schema), rate limits, error conditions, or what 'summary' entails versus detailed reports. This leaves significant gaps for an AI agent to understand the tool's behavior.

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 in the first sentence, followed by structured 'Args' and 'Returns' sections. It's appropriately sized with no redundant information, though the 'Args' section could be integrated more seamlessly into the main text.

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 moderate complexity (2 parameters, no annotations, but with an output schema), the description is partially complete. The output schema likely covers return values, reducing the burden, but critical gaps remain: no authentication context, unclear differentiation from siblings, and incomplete parameter documentation. It meets a bare minimum but lacks depth for safe and effective use.

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 description coverage is 0%, so the schema provides no parameter details. The description only mentions the 'hash' parameter as 'MD5/SHA1/SHA256', adding some semantic value, but doesn't explain the 'api_key' parameter at all. Given two parameters with zero schema coverage, the description inadequately compensates, leaving half the parameters undocumented.

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 resource 'summary of all the file behavior reports from all the sandboxes', which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'get_file_behavior_report' or 'get_file_report', leaving some ambiguity about when to choose this tool over those alternatives.

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 like 'get_file_behavior_report' or 'get_file_report'. It mentions retrieving summaries 'from all the sandboxes', which implies a broad scope, but doesn't clarify if this is for aggregated data or specific use cases compared to other file-related tools.

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