Skip to main content
Glama

generate_code

Convert captured network flows into a runnable scraper script. Preserves request order and session cookies for faithful replay.

Instructions

Turn captured flows into a runnable scraper script — the final deliverable.

flow_ids may be a list or a comma-separated string. The order is preserved in the generated script and all requests share one Session, so a "log in, then call the API" sequence replays correctly with cookies carried across.

framework = curl_cffi (default; TLS fingerprint impersonation, best for scraping) | httpx | requests | curl (emits a shell script instead).

Original request headers are kept, minus the ones the client manages itself.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
body_maxNo
flow_idsYes
frameworkNocurl_cffi
impersonateNochrome

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
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, and it discloses several important behaviors: order is preserved, requests share one Session for cookie continuity, and specific framework defaults are explained. It also mentions that original headers are kept except client-managed ones. It does not cover all nuances like body_max or impersonate behavior, but the disclosed behavior is substantive.

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 efficient and front-loaded, with the first sentence stating the purpose immediately. Each subsequent sentence adds useful information about input formats, frameworks, or headers. It's not perfectly tight—the header and framework details could be merged without loss—but it earns a solid 4.

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?

Given the complexity of 4 parameters and 0% schema coverage, the description covers the key usage behaviors well: input formats, ordering, session/cookie continuity, framework variations, and header filtering. It lacks explanation for body_max, impersonate, and the precise nature of the return value, but the presence of an output schema mitigates the last missing piece.

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 0%, requiring the description to compensate, and it does for flow_ids by clarifying that it accepts a list or comma-separated string with order preservation. It also explains the framework parameter meaningfully (curl_cffi default, curl emits a shell script). However, body_max and impersonate and both left unexplained, adding deficient coverage for 2 of 4 parameters.

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 a specific verb and resource: 'Turn captured flows into a runnable scraper script'. It also states its role as 'the final deliverable', which distinguishes it from siblings like replay_flow or inspect_flow. An agent can tell this tool produces code rather than executing or analyzing flows.

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 provides clear context by framing the tool as the end deliverable producer, suggesting use at the finalization stage. However, it does not explicitly point to alternatives or state when not to use it (e.g., 'use replay_flow to test instead'). It earns a 4 for clear context without exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.