Skip to main content
Glama

extract_from_flow

Extract specific data from network traffic flows using JSONPath, CSS selectors, or regex. Retrieve tokens, IDs, or HTML elements from captured responses for reuse in security testing.

Instructions

Extract specific data from a flow's response body using JSONPath, CSS selector, or regex.

PREREQUISITE: Get flow_id from get_traffic_summary or search_traffic.

Choose exactly ONE extractor per call:

  • json_path: For JSON API responses. Example: "$.data.users[0].id"

  • css_selector: For HTML pages. Example: "input[name=csrf]" to find CSRF tokens

  • regex: For any text. Example: 'token":"([^"]+)' to capture a token value

To save the extracted value for reuse in replay_flow, use extract_session_variable instead.

Args: flow_id: The flow ID to extract from json_path: JSONPath expression (e.g. "$.data.users[0].id", "$.token") css_selector: CSS selector for HTML (e.g. "input[name=csrf]", "a.secret-link") regex: Regex pattern — use capture groups to extract specific parts (e.g. 'token":"([^"]+)')

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regexNo
flow_idYes
json_pathNo
css_selectorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/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. It discloses the three extraction methods with examples and implies a read-only operation via 'extract'. However, it does not explicitly state what happens if multiple extractors are supplied or if no extractor is provided, leaving some behavioral ambiguity.

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 moderately long but organized with sections (purpose, prerequisite, extractor options, alternative, args). Every sentence adds value; the length is justified by covering three extraction methods, though it could be slightly tightened.

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

Completeness5/5

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

Given the tool's complexity, the description covers prerequisites, usage rules, parameter semantics, and alternatives. An output schema exists, so return values need not be described. The description is complete for selecting and invoking the tool correctly.

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?

Schema description coverage is 0%, but the description fully compensates by explaining flow_id, json_path, css_selector, and regex with concrete examples and constraints (e.g., 'use capture groups to extract specific parts'). It also clarifies that exactly one extractor must be chosen.

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 tool extracts specific data from a flow's response body using JSONPath, CSS selector, or regex. It specifies the resource ('a flow's response body') and verb ('Extract'), and distinguishes from sibling tools like extract_session_variable and inspect_flow.

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

Usage Guidelines5/5

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

Explicitly provides a prerequisite (get flow_id from get_traffic_summary or search_traffic), instructs to choose exactly one extractor per call, and directs users to extract_session_variable when the value is needed for replay_flow. This clearly states when and how to use the tool versus alternatives.

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/BobongKu/nodriver-proxy-mcp'

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