Skip to main content
Glama
ExQA
by ExQA

mock_rule_create_from_entry

Create or extend a mock rule from a captured traffic entry, matching request variants by method, path, and body/query fields, then patch live responses or serve recorded fixtures.

Instructions

Create or extend the rule for one request variant (method + path + body/query values) from a captured entry. match_body_fields picks the variant, e.g. ["/action"] for POSTs; leave it empty for GETs. host_scope="any" (default) applies the rule on every routed host, since the same API runs on several hosts; "exact" limits it to the entry's host, and host accepts a glob such as .example.com. match_path replaces the entry's exact path with a pattern where * stands for one segment or part of one, for segments that differ by platform or app version: /api//payoneer covers /api/p24-aos2/payoneer and its iOS twin. It must cover the entry's path. mode="patch": the real server answers; request_patches edit the request body, request_headers set (or remove with null) request headers before it is forwarded, response_patches edit only the named response fields. mode="fixture": answer from the captured response with any status (e.g. 500), never contacting the server (request edits are ignored). status overrides the response code in either mode; delay_ms waits that many milliseconds before answering, to test loaders and client timeouts. merge=true adds to the variant's existing rule; a patch on the same pointer replaces the old one. Patches are checked against the captured entry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostNo
modeNopatch
mergeNo
sourceYes
statusNo
rule_idNo
delay_msNo
entry_idYes
priorityNo
capture_idNo
host_scopeNoany
match_pathNo
descriptionNo
recording_pathNo
request_headersNoRequest headers to change before the request is forwarded upstream (patch mode only): {"X-App-Version": "9.9.9", "X-Debug": null}. A value sets or replaces the header; null removes it. Host and Content-Length are managed by the dispatcher and cannot be set.
request_patchesNoJSON Pointer edits: {"op": "set", "path": "/data/balance", "value": 0} or {"op": "remove", "path": "/data/banner"}; "/items/-" appends. Address array elements by a field, not an index, since servers may reorder them: "/data/balanceList/[currency=USD]/balance".
response_patchesNoJSON Pointer edits: {"op": "set", "path": "/data/balance", "value": 0} or {"op": "remove", "path": "/data/banner"}; "/items/-" appends. Address array elements by a field, not an index, since servers may reorder them: "/data/balanceList/[currency=USD]/balance".
match_body_fieldsNoJSON Pointers into the captured request body whose values the rule must match, e.g. ["/action"]. JSON and form bodies are supported.
match_query_fieldsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
ruleYes
warningsNo
next_stepYes
rule_jsonYes
fixture_fileNo
archived_previousNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden. It discloses mode semantics (patch vs fixture), that patch mode contacts the server while fixture uses the captured response, merge behavior (adds to existing rule, replaces on same pointer), host_scope handling, match_path coverage requirement, and that patches are validated against the entry. It does not cover error conditions or side effects beyond 'create or extend', but covers the key runtime behavior well.

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 long (~180 words) but justified for a 19-parameter tool. It front-loads the purpose and then systematically covers parameters. Some sentences, like the match_path example, are dense but add clarity. It could be slightly tightened, but it is well-structured and each sentence contributes to understanding.

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?

The description covers the core behavior and most key parameters, but leaves several parameters undocumented (priority, description, capture_id, recording_path, match_query_fields) and assumes the agent understands what an 'entry' is and how to obtain entry_id from sibling tools. Given the tool's complexity, an agent might need to consult other tools or schema for full context, but the description is adequate for the primary use case.

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

Parameters4/5

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

Given only 21% schema description coverage, the description compensates by explaining most critical parameters inline: match_body_fields (with example), host_scope (any/exact/host glob), match_path (pattern semantics and example), mode, status, delay_ms, merge, request_patches, response_patches, and request_headers. It adds meaning beyond the schema, though a few parameters (capture_id, recording_path, match_query_fields, priority, description) remain unexplained.

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 opens with a clear, specific statement: "Create or extend the rule for one request variant (method + path + body/query values) from a captured entry." It names the verb ('create/extend'), the resource ('rule'), and the precise scope ('one request variant from a captured entry'), making it clearly distinguishable from siblings like mock_create_from_entry, which focuses on a different mechanism.

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 gives extensive context on how to use the tool: it explains variant selection via match_body_fields, host_scope options, match_path patterns, mode differences, merge behavior, and status/delay overrides. It doesn't explicitly name alternatives or state 'when not to use', but it implies the use case (creating a rule from a captured entry) and provides enough guidance to select this tool for that purpose.

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