Sanity
Headless CMS platform for managing projects, datasets, documents, and webhooks via the Sanity HTTP API.
Categories: Content Management, Developer Tools
What you can ask
- List documents in the
blog.postschema published in the last 30 days. - Update the
homepagedocument to use the new Q2 hero image. - Find draft documents older than 60 days for cleanup.
Set up
Sanity connects with credentials from your Sanity account. Have these values ready:
- Project ID
- Dataset name
- API token
- Go to Organization > Connectors and find Sanity.
- Click Enable and choose which tools to allow.
- Each member enters their own values the first time they use it.
To use one account for the whole organization, turn on Share one connection with everyone. Every member's agents then act as that account, with exactly the access it has.
Tools
Sanity offers 25 tools. Admins choose which ones agents can use. See Tool permission groups.
Read (12)
View and search information without changing it.
| Tool | What it does |
|---|---|
get_document | Fetch one or more documents by ID, bypassing any CDN cache. |
get_document_history | Retrieve a document's state at a specific revision or point in time. |
get_project | Get details for a specific Sanity project. |
get_webhook | Get a webhook's full configuration including filter, projection, and headers. |
list_cors_origins | List CORS origins allowed to call the project's API from a browser. |
list_datasets | List all datasets in a project with their ACL mode and creation time. |
list_project_features | List feature flags enabled for a project, such as private datasets or scheduled publishing. |
list_projects | List all Sanity projects the authenticated user is a member of. |
list_webhook_attempts | List delivery attempts for a webhook including HTTP status codes. |
list_webhooks | List all webhooks configured for a project. |
query_documents | Run a GROQ query over a dataset. |
validate_credential | Validate Sanity API token and project ID by fetching the configured project. |
Write (4)
Create or send data.
| Tool | What it does |
|---|---|
create_cors_origin | Whitelist an origin (e.g., https://example.com) to call the API from a browser. |
create_dataset | Create a new dataset in a project. |
create_document | Create a new document. |
create_webhook | Create a webhook that fires on document create/update/delete events matching a GROQ filter. |
Delete or overwrite (9)
Remove or replace existing data.
| Tool | What it does |
|---|---|
create_or_replace_document | Create a document, or fully replace an existing document with the same _id. |
delete_cors_origin | Remove a CORS origin by its numeric ID. |
delete_dataset | Delete a dataset permanently. |
delete_document | Delete a document by ID. |
delete_webhook | Delete a webhook permanently. |
patch_document | Apply a partial update (set / unset / inc / dec / setIfMissing) to an existing document. |
update_dataset | Update a dataset's ACL mode to 'public' or 'private'. |
update_project | Update a project's display name, studio host, or metadata. |
update_webhook | Update a webhook's configuration. |