Skip to main content
Glama
badchars

osint-mcp-server

by badchars

vt_ip

Analyze an IP address with VirusTotal to retrieve reputation, detection statistics, country, ASN, and network information. Requires a VirusTotal API key.

Instructions

VirusTotal IP analysis: reputation, detection stats, country, ASN, network. Requires VT_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYesIP address to analyze

Implementation Reference

  • The vtIp function is the core handler for the vt_ip tool. It calls the VirusTotal /ip_addresses/{ip} API endpoint, caches results with a 10-minute TTL, and returns IP reputation, analysis stats, country, ASN, AS owner, and network info.
    export async function vtIp(ip: string, apiKey: string): Promise<VtIpResult> {
      const cacheKey = `vt:ip:${ip}`;
      const cached = cache.get(cacheKey);
      if (cached) return cached;
    
      const data = await vtFetch(`/ip_addresses/${encodeURIComponent(ip)}`, apiKey);
      if (!data) throw new Error(`IP ${ip} not found on VirusTotal`);
    
      const attrs = data.data?.attributes ?? {};
      const result: VtIpResult = {
        ip,
        reputation: attrs.reputation ?? 0,
        analysisStats: attrs.last_analysis_stats ?? { malicious: 0, suspicious: 0, undetected: 0, harmless: 0 },
        country: attrs.country,
        asn: attrs.asn,
        asOwner: attrs.as_owner,
        network: attrs.network,
      };
    
      cache.set(cacheKey, result);
      return result;
    }
  • VtIpResult interface defines the output schema for vt_ip: ip, reputation, analysisStats (malicious/suspicious/undetected/harmless counts), country, asn, asOwner, and network.
    interface VtIpResult {
      ip: string;
      reputation: number;
      analysisStats: VtAnalysisStats;
      country?: string;
      asn?: number;
      asOwner?: string;
      network?: string;
    }
  • Registration of the vt_ip tool as a ToolDef: name 'vt_ip', description, Zod schema (ip: string), and execute handler that extracts API key from config and calls the vtIp function.
    const vtIpTool: ToolDef = {
      name: "vt_ip",
      description: "VirusTotal IP analysis: reputation, detection stats, country, ASN, network. Requires VT_API_KEY.",
      schema: {
        ip: z.string().describe("IP address to analyze"),
      },
      execute: async (args, ctx) => {
        const key = requireApiKey(ctx.config.vtApiKey, "VirusTotal", "VT_API_KEY");
        return json(await vtIp(args.ip as string, key));
      },
    };
  • Generic vtFetch helper used by vtIp — rate-limited fetch to the VirusTotal v3 API with JSON parsing and 404 handling.
    async function vtFetch(path: string, apiKey: string): Promise<any> {
      await limiter.acquire();
      const res = await fetch(`${VT_BASE}${path}`, {
        headers: { "x-apikey": apiKey },
      });
      if (res.status === 404) return null;
      if (!res.ok) throw new Error(`VirusTotal API error: ${res.status} ${res.statusText}`);
      return res.json();
    }
  • src/index.ts:37-37 (registration)
    Tool listing registration: 'vt_ip' is listed under the VirusTotal provider group, requiring VT_API_KEY environment variable.
    { label: "VirusTotal", env: "VT_API_KEY", tools: ["vt_domain", "vt_ip", "vt_subdomains", "vt_url"] },
Behavior4/5

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

No annotations are provided, so the description must fill in. It discloses the need for an API key and lists the data returned (reputation, detection stats, country, ASN, network), which adds transparency beyond the tool name. However, it does not discuss rate limits, error handling, or any side effects.

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 two sentences with no redundancy: first sentence lists capabilities, second sentence mentions the required API key. Information is front-loaded and each sentence adds value.

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

Completeness4/5

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

For a tool with one parameter (fully documented in schema), a clear purpose, and known output fields, the description covers key context. It lacks details on output format or error cases, but given the simplicity, it is reasonably complete.

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?

The input schema has 100% description coverage for the single parameter 'ip', already explaining 'IP address to analyze'. The description adds no extra meaning beyond what the schema provides, so baseline 3 is appropriate.

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 'VirusTotal IP analysis' with specific outputs: reputation, detection stats, country, ASN, network. This distinguishes it from sibling tools like vt_domain, vt_url, and other IP tools.

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 does not explicitly state when to use this tool versus alternatives, nor does it provide exclusions or selection criteria. The requirement of a VT_API_KEY is mentioned but context for when to choose this over other IP tools is implied rather than explicit.

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/badchars/osint-mcp-server'

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