Skip to main content
Glama

get_conversations

Capture network traffic via a specified interface and analyze TCP/UDP conversations for LLM processing. Configure duration to extract real-time statistics for threat hunting, diagnostics, or anomaly detection.

Instructions

Capture live traffic and provide TCP/UDP conversation statistics for LLM analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
durationNoCapture duration in seconds
interfaceNoNetwork interface to capture from (e.g., eth0, en0)en0

Implementation Reference

  • The asynchronous handler function that implements the core logic of the 'get_conversations' tool. It uses tshark to capture packets on the specified network interface for a given duration, computes TCP conversation statistics, formats the output, and returns it as text content for LLM analysis.
    async (args) => {
      try {
        const tsharkPath = await findTshark();
        const { interface, duration } = args;
        const tempPcap = 'temp_capture.pcap';
        console.error(`Capturing conversations on ${interface} for ${duration}s`);
    
        await execAsync(
          `${tsharkPath} -i ${interface} -w ${tempPcap} -a duration:${duration}`,
          { env: { ...process.env, PATH: `${process.env.PATH}:/usr/bin:/usr/local/bin:/opt/homebrew/bin` } }
        );
    
        const { stdout, stderr } = await execAsync(
          `${tsharkPath} -r "${tempPcap}" -qz conv,tcp`,
          { env: { ...process.env, PATH: `${process.env.PATH}:/usr/bin:/usr/local/bin:/opt/homebrew/bin` } }
        );
        if (stderr) console.error(`tshark stderr: ${stderr}`);
    
        await fs.unlink(tempPcap).catch(err => console.error(`Failed to delete ${tempPcap}: ${err.message}`));
    
        return {
          content: [{
            type: 'text',
            text: `TCP/UDP conversation statistics for LLM analysis:\n${stdout}`,
          }],
        };
      } catch (error) {
        console.error(`Error in get_conversations: ${error.message}`);
        return { content: [{ type: 'text', text: `Error: ${error.message}` }], isError: true };
      }
    }
  • Zod input schema defining parameters for the tool: 'interface' (string, optional, default 'en0') and 'duration' (number, optional, default 5).
    {
      interface: z.string().optional().default('en0').describe('Network interface to capture from (e.g., eth0, en0)'),
      duration: z.number().optional().default(5).describe('Capture duration in seconds'),
    },
  • index.js:141-179 (registration)
    The server.tool() call that registers the 'get_conversations' tool with the MCP server, specifying the name, description, input schema, and handler function.
    server.tool(
      'get_conversations',
      'Capture live traffic and provide TCP/UDP conversation statistics for LLM analysis',
      {
        interface: z.string().optional().default('en0').describe('Network interface to capture from (e.g., eth0, en0)'),
        duration: z.number().optional().default(5).describe('Capture duration in seconds'),
      },
      async (args) => {
        try {
          const tsharkPath = await findTshark();
          const { interface, duration } = args;
          const tempPcap = 'temp_capture.pcap';
          console.error(`Capturing conversations on ${interface} for ${duration}s`);
    
          await execAsync(
            `${tsharkPath} -i ${interface} -w ${tempPcap} -a duration:${duration}`,
            { env: { ...process.env, PATH: `${process.env.PATH}:/usr/bin:/usr/local/bin:/opt/homebrew/bin` } }
          );
    
          const { stdout, stderr } = await execAsync(
            `${tsharkPath} -r "${tempPcap}" -qz conv,tcp`,
            { env: { ...process.env, PATH: `${process.env.PATH}:/usr/bin:/usr/local/bin:/opt/homebrew/bin` } }
          );
          if (stderr) console.error(`tshark stderr: ${stderr}`);
    
          await fs.unlink(tempPcap).catch(err => console.error(`Failed to delete ${tempPcap}: ${err.message}`));
    
          return {
            content: [{
              type: 'text',
              text: `TCP/UDP conversation statistics for LLM analysis:\n${stdout}`,
            }],
          };
        } catch (error) {
          console.error(`Error in get_conversations: ${error.message}`);
          return { content: [{ type: 'text', text: `Error: ${error.message}` }], isError: true };
        }
      }
    );
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 of behavioral disclosure. It mentions 'capture live traffic' and 'provide statistics', but doesn't specify what 'capture' entails (e.g., whether it's passive monitoring, requires admin privileges, affects network performance, or stores data). It also omits details like rate limits, output format, or error conditions. For a tool that interacts with network interfaces, this leaves significant gaps in understanding its 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 a single, efficient sentence that front-loads the core purpose. It avoids unnecessary words and gets straight to the point. However, it could be slightly more structured by separating the capture and statistics aspects, but this is minor.

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

Completeness2/5

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

Given the complexity of network traffic capture and the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'conversation statistics' include (e.g., counts, protocols, bytes), how results are returned, or any behavioral constraints. For a tool with no structured output and potential system-level interactions, more context is needed to guide effective use.

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 100%, with both parameters ('duration' and 'interface') well-documented in the schema. The description doesn't add any meaning beyond the schema—it doesn't explain how these parameters affect the capture or statistics, or provide usage examples. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 tool's purpose with specific verbs ('capture live traffic' and 'provide TCP/UDP conversation statistics') and identifies the resource (network traffic). However, it doesn't explicitly differentiate from sibling tools like 'capture_packets' or 'analyze_pcap', which appear related to network analysis. The mention of 'for LLM analysis' adds specificity but doesn't clarify sibling distinctions.

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. It doesn't mention sibling tools like 'capture_packets' (which might capture raw packets) or 'analyze_pcap' (which might analyze saved files), leaving the agent to guess based on names alone. There are no explicit when/when-not instructions or prerequisites stated.

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

Related 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/0xKoda/WireMCP'

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