Skip to main content
Glama

capture_process

Capture network traffic from a specific process by PID, automatically filtering to the process's active connections for focused analysis.

Instructions

Capture network traffic from a specific process by its PID.

Snapshots the process's active connections at the moment capture starts, builds a BPF filter from those local ports, and captures only the matching traffic. New connections opened after capture starts share the same ports and are included automatically.

Use list_processes() to find the PID, and list_interfaces() to find the interface name.

Args: pid: Process ID to capture traffic for. interface: Network interface to capture on (from list_interfaces). output_pcap: Path where the captured PCAP will be saved. duration: Capture duration in seconds (default: 30, max: 60). packet_count: Maximum packets to capture (default: 200, max: 500). keylog_file: Optional TLS key log file path (SSLKEYLOGFILE format). When provided, decrypted TLS stream content is included in the output. The file must exist before calling this.

Returns: Capture summary showing detected connections, packet list, and (when keylog_file is supplied) decrypted TLS stream content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYes
durationNo
interfaceYes
keylog_fileNo
output_pcapYes
packet_countNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description discloses the snapshot-based BPF filter construction, automatic inclusion of new connections sharing the same ports, and the requirement that keylog_file must exist. It lacks disclosure of permission requirements (e.g., root) or error behavior for invalid PIDs, so it is informative but not exhaustive.

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 well-structured with a clear purpose, mechanics, prerequisites, Args, and Returns sections. Each sentence adds functional detail without redundancy, though the length is justified by the tool's complexity.

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?

The tool has a rich output schema, and the description covers capture mechanics, parameter semantics, and return summary. It omits error handling, permission requirements, and edge cases (e.g., process not found), leaving some context unaddressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates fully by explaining the meaning, defaults, and constraints of all six parameters, including the keylog_file format and pre-existence requirement.

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 states 'Capture network traffic from a specific process by its PID,' which is a specific verb, resource, and scope. It clearly distinguishes from siblings like capture_live or capture_and_decrypt by focusing on process-specific capture.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description instructs to use list_processes() to find the PID and list_interfaces() for the interface, providing clear prerequisites. However, it does not explicitly contrast with alternative capture tools or state when not to use it, so guidance 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/ouonet/tshark-mcp'

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