manage_mock
Manage mock endpoints for HTTP, GraphQL, gRPC, WebSocket, SOAP, MQTT, and OAuth. Create, list, get, update, delete, or toggle mocks with optional stateful binding to resource tables.
Instructions
Create, retrieve, update, delete, list, or toggle mock endpoints. Use 'action' to specify the operation. For list, optionally filter by type or enabled status. For get/update/delete/toggle, provide the mock ID. For create, provide type and protocol-specific configuration.
Examples: List: {"action":"list","type":"http"} Get: {"action":"get","id":"http_060bff782a1de15f"} Create: {"action":"create","type":"http","http":{"matcher":{"method":"GET","path":"/api/hello"},"response":{"statusCode":200,"body":"{"msg":"hello"}"}}} Update: {"action":"update","id":"http_060bff782a1de15f","http":{"response":{"statusCode":201}}} Delete: {"action":"delete","id":"http_060bff782a1de15f"} Toggle: {"action":"toggle","id":"http_060bff782a1de15f","enabled":false}
Stateful binding examples (bind mocks to stateful resource tables for automatic CRUD): List: {"action":"create","type":"http","http":{"matcher":{"method":"GET","path":"/api/users"}},"extend":{"table":"users","action":"list"}} Create: {"action":"create","type":"http","http":{"matcher":{"method":"POST","path":"/api/users"}},"extend":{"table":"users","action":"create"}} Get: {"action":"create","type":"http","http":{"matcher":{"method":"GET","path":"/api/users/{id}"}},"extend":{"table":"users","action":"get"}} Update: {"action":"create","type":"http","http":{"matcher":{"method":"PUT","path":"/api/users/{id}"}},"extend":{"table":"users","action":"update"}} Delete: {"action":"create","type":"http","http":{"matcher":{"method":"DELETE","path":"/api/users/{id}"}},"extend":{"table":"users","action":"delete"}} Custom: {"action":"create","type":"http","http":{"matcher":{"method":"POST","path":"/api/users/{id}/verify"}},"extend":{"table":"users","action":"custom","operation":"VerifyUser"}}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Operation to perform | |
| enabled | No | For toggle: set specific state. For list: filter by enabled status. | |
| extend | No | Bind this mock to a stateful resource table for automatic CRUD. Create the table first with manage_state add_resource. Works with HTTP and SOAP mocks. | |
| graphql | No | GraphQL config (create/update) | |
| grpc | No | gRPC config (create/update) | |
| http | No | HTTP mock spec (required when type=http) | |
| id | No | Mock ID (required for get/update/delete/toggle) | |
| mqtt | No | MQTT config (create/update) | |
| name | No | Mock name (create/update) | |
| oauth | No | OAuth config (create/update) | |
| soap | No | SOAP config (create/update) | |
| type | No | Protocol type for create or list filter | |
| websocket | No | WebSocket config (create/update) |