put_view
[Saved Views]
Create or replace a saved exact query conditionally. Retain requestId after an ambiguous response.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| collectionId | string | Yes | Collection ID from list_collections. |
| definition | json | Yes | The saved query: title and query (required), with an optional description and status. query takes the filter, orderBy, and fields that list_documents accepts. An optional relativeDate keeps a moving window: path (a /data date), period (day, week, or month), timeZone (IANA), and offset (default 0). |
| ifRevision | string | Yes | Use "absent" to create, or the current revision to replace. A stale revision returns revision_conflict. |
| key | string | Yes | Stable view key, unique in its collection. |
| requestId | string | Yes | A fresh UUID for each change. After an ambiguous response, retry with the same requestId and identical arguments; a changed payload returns request_conflict. |
| spaceId | string | Yes | Workspace ID from list_spaces. |
Examples
Replace the sample IDs with values from your store. Use a fresh UUID for each requestId.
Save a query for decisions updated this week.
Arguments
{
"spaceId": "11111111-1111-4111-8111-111111111111",
"collectionId": "33333333-3333-4333-8333-333333333333",
"key": "this-week",
"definition": {
"title": "Updated this week",
"query": {
"orderBy": [
{
"path": "/updatedAt",
"type": "instant",
"direction": "desc"
}
]
},
"relativeDate": {
"path": "/data/decidedOn",
"period": "week",
"timeZone": "Europe/Madrid"
}
},
"ifRevision": "absent",
"requestId": "77777777-7777-4777-8777-777777777777"
}Full MCP request
Full MCP request
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "put_view",
"arguments": {
"spaceId": "11111111-1111-4111-8111-111111111111",
"collectionId": "33333333-3333-4333-8333-333333333333",
"key": "this-week",
"definition": {
"title": "Updated this week",
"query": {
"orderBy": [
{
"path": "/updatedAt",
"type": "instant",
"direction": "desc"
}
]
},
"relativeDate": {
"path": "/data/decidedOn",
"period": "week",
"timeZone": "Europe/Madrid"
}
},
"ifRevision": "absent",
"requestId": "77777777-7777-4777-8777-777777777777"
}
}
}