Skip to main content
Glama
aplaceforallmystuff

MCP Threat Intel Server

threatintel_lookup_hash

Look up a file hash (MD5, SHA1, SHA256) across AlienVault OTX, MalwareBazaar, and other threat intelligence sources to assess maliciousness.

Instructions

Look up a file hash (MD5, SHA1, SHA256) across threat intelligence sources (OTX, MalwareBazaar)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashYesFile hash (MD5, SHA1, or SHA256)

Implementation Reference

  • Tool registration and input schema for threatintel_lookup_hash. Defines the tool name, description, and input schema requiring a 'hash' string parameter (MD5, SHA1, or SHA256).
    {
      name: "threatintel_lookup_hash",
      description: "Look up a file hash (MD5, SHA1, SHA256) across threat intelligence sources (OTX, MalwareBazaar)",
      inputSchema: {
        type: "object" as const,
        properties: {
          hash: {
            type: "string",
            description: "File hash (MD5, SHA1, or SHA256)",
          },
        },
        required: ["hash"],
      },
    },
  • Handler for threatintel_lookup_hash. Extracts the hash from args, determines hash type by length (MD5=32, SHA1=40, SHA256=64), queries OTX (if configured) and MalwareBazaar (always attempted), and returns aggregated JSON results.
    // Unified hash lookup
    case "threatintel_lookup_hash": {
      const { hash } = args as { hash: string };
      const results: Record<string, unknown> = { hash };
    
      // OTX
      if (services.otx) {
        try {
          const hashType = hash.length === 32 ? "MD5" : hash.length === 40 ? "SHA1" : "SHA256";
          const otxResult = await apiRequest<unknown>(
            `${config.otx.baseUrl}/indicators/file/${hashType}/${hash}/general`,
            { headers: { "X-OTX-API-KEY": config.otx.apiKey! } }
          );
          results.otx = otxResult;
        } catch (e) {
          results.otx = { error: e instanceof Error ? e.message : String(e) };
        }
      }
    
      // MalwareBazaar
      try {
        const mbResult = await apiRequest<unknown>(
          config.abusech.malwarebazaar,
          {
            method: "POST",
            headers: { "Content-Type": "application/x-www-form-urlencoded" },
            body: `query=get_info&hash=${encodeURIComponent(hash)}`,
          }
        );
        results.malwarebazaar = mbResult;
      } catch (e) {
        results.malwarebazaar = { error: e instanceof Error ? e.message : String(e) };
      }
    
      return {
        content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
      };
    }
  • src/index.ts:363-374 (registration)
    Server registration. The MCP server is created with name 'mcp-threatintel' and tools capability, then handles ListToolsRequestSchema and CallToolRequestSchema. The TOOLS array (including threatintel_lookup_hash) is registered via ListToolsRequestSchema handler.
    // Create server instance
    const server = new Server(
      {
        name: "mcp-threatintel",
        version: "1.0.0",
      },
      {
        capabilities: {
          tools: {},
        },
      }
    );
  • Generic API request helper used by the hash lookup handler to make HTTP requests to OTX and MalwareBazaar endpoints.
    async function apiRequest<T>(
      url: string,
      options: RequestInit = {}
    ): Promise<T> {
      const response = await fetch(url, {
        ...options,
        headers: {
          "Content-Type": "application/json",
          "Accept": "application/json",
          ...(options.headers || {}),
        },
      });
    
      if (!response.ok) {
        const text = await response.text();
        throw new Error(`API error ${response.status}: ${text}`);
      }
    
      return response.json() as Promise<T>;
    }
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It omits any mention of side effects (none expected as read-only), error conditions (e.g., hash not found), API rate limits, or authentication requirements. The description is minimal and does not prepare the agent for potential issues.

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

Conciseness5/5

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

The description is a single sentence of 13 words, directly stating the action and key details (hash types, sources). It is efficiently front-loaded with the verb and resource, with no filler or redundant information.

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 simplicity (1 parameter, no output schema, no annotations), the description covers the essential purpose but fails to describe the return format or any error handling. It is adequate for a minimum viable description but lacks completeness in explaining what the agent will receive after invocation.

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 coverage is 100% with the hash parameter described. The description adds value by specifying the intelligence sources (OTX, MalwareBazaar), which is not in the schema. This additional context helps the agent understand the scope and reliability of the lookup, improving upon the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('look up'), the resource ('file hash'), and specifies the supported hash types (MD5, SHA1, SHA256) and intelligence sources (OTX, MalwareBazaar). This distinguishes it from sibling tools like threatintel_lookup_domain or threatintel_lookup_ip, which are for different resource types.

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?

The description implies usage for file hash lookups but does not explicitly state when to use this tool versus alternatives (e.g., threatintel_lookup_domain for domains). No guidance on prerequisites or when not to use is provided, leaving the agent to infer context from the tool name and siblings.

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/aplaceforallmystuff/mcp-threatintel'

If you have feedback or need assistance with the MCP directory API, please join our Discord server