Query documents (GROQ) (yekar.sanity.query) | Read | Run a GROQ query against the connection's dataset and return the result. This is the general read: filter by type, follow references with ->, project fields, order and slice. Reads published documents AND drafts (drafts.<id>) - add a filter if you want only one. |
Get document (yekar.sanity.get-document) | Read | Fetch one document by id. A published document and its draft are two separate documents in Sanity ('drafts.<id>'), so this says which one it returned rather than leaving it to be assumed. |
List datasets (yekar.sanity.list-datasets) | Read | List the project's datasets, marking the one this connection uses. Informational: every other tool acts on the connected dataset and cannot be pointed at another - connect a second time to reach a different one. |
Create document (yekar.sanity.create-document) | Write | Create a document in the connection's dataset. Writes land on the DRAFT (drafts.<id>) by default - nothing the site serves changes until Publish document promotes it. Creating ACCUMULATES: without an explicit id, a retry makes a second document - pass id + ifNotExists when a repeat must be harmless. |
Patch document (yekar.sanity.patch-document) | Write | Set or unset fields on an existing document. Writes land on the DRAFT (drafts.<id>) by default - nothing the site serves changes until Publish document promotes it. Patching the DRAFT of a document that has never had one fails - read it first and create the draft (Create document with the published id) if there is none. |
Delete document (yekar.sanity.delete-document) | Write | Delete a document. Deleting the published document REMOVES IT FROM THE SITE at the next build, and there is no undo through this tool - Sanity keeps history for the retention your plan allows, recoverable only from the Studio. A reference from another document to a deleted one is left dangling. |
Publish document (yekar.sanity.publish-document) | Write | Promote a document's draft to the published document. This is what makes an edit LIVE: the draft is consumed, and the site shows the new content at its next build. Publishing a document with no draft is an error, not a no-op. |
Unpublish document (yekar.sanity.unpublish-document) | Write | Take a document off the site while keeping its content: the published document is removed and its content becomes a draft. This is the reversible opposite of publishing - unlike Delete document, nothing is lost. |
Discard draft (yekar.sanity.discard-draft) | Write | Throw away a document's unpublished draft, leaving the published document as it is. The draft's edits are gone - this is the 'abandon these changes' verb, not a way to remove the live document (that is Unpublish document). |