Skip to main content
Glama

Add an intercept-and-transform rule

proxy_mock_transform

Intercept HTTP requests, forward to the real backend, and apply in-place JSON patches to modify responses. Supports conditional matching and dynamic timestamps for mocking or transforming API data.

Instructions

Intercept a request, forward it to the real backend, parse the JSON response, apply in-place patches (path + optional where + set), and return the modified response. Use [] for array wildcards in path, where for conditional matching, and __NOW__ / __NOW_PLUS_<N><UNIT>__ macros for dynamic timestamps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL pattern. Default is glob/substring matched against the full absolute URL. With regex=true, a raw JS regex source.
regexNoTreat 'url' as a raw regex (default false).
methodYesHTTP method: GET, POST, PUT, DELETE, PATCH, HEAD, or OPTIONS.
patchesYesOne or more JSON patch operations.
Behavior3/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 describes the transformation behavior (patches, macros, wildcards) and the flow. However, it doesn't disclose side effects: whether this persists across sessions, whether it only applies to matching requests, whether it modifies backend behavior or just the observed response, or what happens to non-JSON responses. The in-place nature is mentioned but operational side effects are not covered.

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 well-structured sentence explaining the end-to-end mechanism, followed by a helpful syntax hint sentence. It's front-loaded with the core purpose. Reasonably efficient, though it could be tightened—the detail about macros and where-clauses is valuable enough to justify the second sentence.

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 no output schema (so return format is undefined) and no annotation, the description covers the mechanism well: how patches are applied, what the matching semantics are, and the macro syntax. It could mention edge cases (non-JSON responses, matched-URL specificity), but for an intercept-transform tool with 4 params fully described in schema, this is reasonably complete.

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%, so the baseline is 3. The description adds useful semantic detail about the patch format (path wildcards, where, macros) which complements the schema nicely. However, it doesn't add anything beyond what the schema parameter descriptions already specify, so it stays at the baseline 3.

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 action: intercept a request, forward to backend, parse JSON, apply in-place patches, return modified response. It distinguishes itself from mock tools (mocking responses) and other transform tools by specifying the in-place intercept-and-transform flow. However, it doesn't explicitly differentiate from the sibling proxy_transform tools (proxy_mock_transform vs proxy_transform vs proxy_update_transform), so it loses one point on 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 Guidelines4/5

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

The description includes usage details on how to use path wildcards (`[]`), `where` for conditional matching, and time macros. It explains the execution pipeline (intercept, forward, parse, patch, return). It doesn't explicitly state when NOT to use this vs proxy_mock_response or proxy_transform, but the mechanism is fairly clear from the flow description, giving it a borderline 4.

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

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