Set Mock Response
set_mock_responseInstall a Proxyman mock rule to return static JSON responses or transform live backend responses via JSON Patch. Supports session-scoped or persistent standalone mocks.
Instructions
Install a live response-mocking rule via Proxyman. Two modes: staticResponse (return a verbatim payload — feature flags, fixtures) and responseTransform.jsonPatch (proxy to the real backend then mutate the response body in flight — e.g. the loginStatus override pattern). Session-scoped mocks auto-clean on stop_and_compile_test; standalone mocks persist until explicitly cleared. Requires Proxyman running with MCP enabled.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mock | Yes | ||
| sessionId | No | Active recording session ID. Mocks tagged with the session auto-clean on stop_and_compile_test. OMIT to install a STANDALONE mock that persists until explicitly cleared via clear_mock_responses ({ mockId } or { allStandalone: true }) — useful for agents mocking outside any recording session. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | Yes | Whether the mock is auto-cleaned on stop_and_compile (session) or persists (standalone) | |
| mockId | Yes | Stable mock ID (echoed if provided, generated if not) | |
| ruleName | Yes | Display name of the rule in Proxyman: mca:<sessionId>:<mockId> for session-scoped, or mca:standalone:<mockId> for standalone. | |
| proxymanRuleId | Yes | Proxyman rule ID, useful for direct inspection in the Proxyman UI | |
| totalSessionMocks | No | Total active mocks for this session after this call. Only set when scope === "session". | |
| totalStandaloneMocks | No | Total active standalone mocks after this call. Only set when scope === "standalone". |