manage_state
Create and manage stateful mock resources with CRUD operations that persist data across requests. Perform actions like overview, add, list, get, create, reset, and delete.
Instructions
Manage stateful mock resources — CRUD collections that persist data across requests. Use 'overview' to see all resources, 'add_resource' to create a new resource with full table configuration, 'list_items' to browse items in a resource, 'get_item' for a specific item, 'create_item' to add data, 'reset' to restore seed data, or 'delete_resource' to fully unregister a resource.
Examples: Overview: {"action":"overview"} Add resource:{"action":"add_resource","resource":"users"} Add resource:{"action":"add_resource","resource":"customers","id_strategy":"prefix","id_prefix":"cus_","seed_data":[{"name":"Alice"}]} List items: {"action":"list_items","resource":"users","limit":10} Get item: {"action":"get_item","resource":"users","item_id":"abc123"} Create item: {"action":"create_item","resource":"users","data":{"name":"Alice"}} Reset: {"action":"reset","resource":"users"} Delete resource: {"action":"delete_resource","resource":"users"}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Operation to perform | |
| data | No | Item data (required for create_item) | |
| id_field | No | Custom ID field name (default: 'id', for add_resource) | |
| id_prefix | No | Prefix for generated IDs when id_strategy is 'prefix' (e.g., 'cus_' for customer IDs) | |
| id_strategy | No | ID generation strategy for new items | |
| item_id | No | Item ID (required for get_item) | |
| limit | No | Max items for list_items | |
| max_items | No | Maximum number of items the resource can hold (0 = unlimited) | |
| offset | No | Pagination offset for list_items | |
| order | No | Sort order: asc or desc | desc |
| parent_field | No | Foreign key field name for nested/child resources | |
| relationships | No | Relationship definitions for ?expand[] support. Map of field name to {table, field} objects. | |
| resource | No | Resource name (required for add_resource/list_items/get_item/create_item/reset/delete_resource) | |
| response | No | Response transform configuration. Controls how list/get responses are shaped (envelope, pagination, field mapping). | |
| seed_data | No | Initial data items to populate the resource with. Each item is an object. | |
| sort | No | Sort field for list_items | createdAt |