Skip to main content
Glama

add_rewrite

Destructive

Modify matching HTTP requests and responses in flight with ordered steps for headers, query parameters, bodies, JSON fields, status codes, or URLs to test and debug traffic without backend changes.

Instructions

Edit matching traffic in flight. Steps run in order. Types: set_header/add_header {name,value}, remove_header {name}, set_query {name,value} / remove_query {name} (request), replace_body {pattern,value,regex}, json_set {path:"$.user.isPremium", value:"true"} (value is JSON text), json_remove {path}, set_status {status} (response), set_url {value} / set_path {value} (request). Compressed bodies are decoded first.

Input Schema

NameRequiredDescriptionDefault
ttlNo1h
urlYesURL pattern with * wildcards
nameNo
phaseNoresponse
stepsYesOrdered steps, e.g. [{"type":"json_set","path":"$.user.isPremium","value":"true"}]
methodsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare destructive/readOnly/openWorld/idempotent status, and the description adds meaningful operation behavior: steps execute in order, compressed bodies are decoded first, and some step types are limited to request or response phases. It still does not explain rule persistence, TTL expiry, conflicts, or what existing rules are affected.

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 front-loaded and dense: it states the core action first, then step ordering, then the supported step types. Every sentence carries operational detail without filler, though the type list is long.

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

Completeness3/5

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

For a destructive, no-output-schema mutation tool, the description explains the step language well enough to construct steps, but it omits rule lifecycle and several non-step parameters (ttl, name, methods, phase default). That leaves gaps an agent needs to call it safely and correctly.

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 coverage is only 33%, so the description must compensate. It thoroughly documents the central steps parameter by listing step types, field shapes, JSON-text semantics, and request/response constraints, but it leaves ttl, name, phase defaults, and methods undocumented.

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 uses a specific verb ('Edit') and resource ('matching traffic in flight') and explains the ordered-step model, so the core purpose is clear. It does not mention sibling rule-management tools such as remove_rule or list_rules, so it lacks explicit sibling differentiation.

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?

There is no explicit when-to-use guidance or comparison with alternatives like set_breakpoint, add_map_local/add_map_remote, or remove_rule; the agent must infer usage from the purpose. The behavioral constraints (ordered steps, compressed-body decoding) are not usage guidance.

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