Sanity MCP Server
Provides tools for full CRUD operations, GROQ queries, document management, reference tracking, diff, history, bulk operations, and draft status on Sanity content platform.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Sanity MCP Servershow me the last 10 published posts with their categories"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ฎ Sanity MCP Server
The self-hosted Sanity MCP that Sanity deprecated. Full CRUD, atomic transactions, reference tracking, and tools the official server doesn't have.
Why This Exists
Sanity's official MCP server (@sanity/mcp-server) is archived. They want you to use their hosted solution at mcp.sanity.io with OAuth.
That's fine if you want:
OAuth flows for every AI tool
Dependency on Sanity's infrastructure
No offline or air-gapped usage
Whatever tools they decide to expose
This MCP gives you:
๐ Simple token auth โ one env var, done
๐ Self-hosted โ runs anywhere, no external dependencies
๐ ๏ธ More tools โ reference tracking, diff, history, bulk ops
โก Works offline โ no OAuth dance, no hosted service required
Related MCP server: DataFlow MCP Server
Quick Start
npx @purple-horizons/sanity-mcpOr install globally:
npm install -g @purple-horizons/sanity-mcpMCP Configuration
Add to your Claude Desktop, Cursor, or VS Code config:
{
"mcpServers": {
"sanity": {
"command": "npx",
"args": ["@purple-horizons/sanity-mcp"],
"env": {
"SANITY_PROJECT_ID": "your-project-id",
"SANITY_DATASET": "production",
"SANITY_TOKEN": "sk-your-token"
}
}
}
}Tools
๐ Read Operations
Tool | Description |
| Execute any GROQ query |
| Fetch a single document by ID |
| List documents by type with pagination |
| Full-text search across content |
| Discover all document types |
| Get schema info for a type |
| Count documents matching a filter |
โ๏ธ Write Operations
Tool | Description |
| Create a new document |
| Replace an entire document |
| Partially update specific fields |
| Delete a document |
| Publish a draft |
| Move published to draft |
๐ Unique Tools (Not in Sanity's Official MCP)
Tool | Description |
| Find all documents referencing a given doc โ essential before deleting |
| Compare two documents โ draft vs published, or any two docs |
| Get revision history โ see who changed what |
| Atomic batch operations โ all succeed or all fail |
| Check publish state โ draft, published, or both |
What Makes This Better
1. Reference Tracking
Before you delete that image asset, you probably want to know what's using it:
sanity_references id="image-abc123"
โ Shows all 47 blog posts using that imageSanity's official MCP doesn't have this. You'd find out the hard way.
2. Document Diffing
Content editor made changes. What changed?
sanity_diff idA="drafts.post-xyz" idB="post-xyz"
โ Shows exactly which fields differSee the diff before you publish. Or compare any two documents.
3. Atomic Bulk Operations
Update 50 documents and they all need to succeed together? One transaction:
sanity_bulk operations=[
{ "patch": { "id": "post-1", "set": { "featured": true }}},
{ "patch": { "id": "post-2", "set": { "featured": false }}},
...
]
โ All or nothing. No partial states.With dryRun: true, validate before executing.
4. Draft Status at a Glance
Is there a draft? Is it published? Both?
sanity_draft_status id="post-abc123"
โ { status: "both", hasUnpublishedChanges: true }No more manually checking drafts.{id} vs {id}.
Environment Variables
Variable | Required | Default | Description |
| โ | โ | Your Sanity project ID |
| โ |
| Dataset name |
| โ | โ | API token (required for writes) |
| โ |
| API version |
Getting Your Token
Go to sanity.io/manage
Select your project โ API โ Tokens
Add new token with Editor or higher permissions
Copy and set as
SANITY_TOKEN
GROQ Examples
// All posts, newest first
*[_type == "post"] | order(_createdAt desc)
// Specific post by slug
*[_type == "post" && slug.current == "hello-world"][0]
// Posts with expanded author
*[_type == "post"]{
title,
slug,
"author": author->name,
"category": category->title
}
// Count by category
{
"total": count(*[_type == "post"]),
"published": count(*[_type == "post" && !(_id in path("drafts.**"))])
}
// Full-text search
*[_type == "post" && title match "AI*"]Development
# Clone
git clone https://github.com/Purple-Horizons/sanity-mcp.git
cd sanity-mcp
# Install
npm install
# Build
npm run build
# Test
npm test
# Run locally
npm run devComparison
Feature | This MCP | Sanity Official |
Self-hosted | โ | โ (archived) |
Simple token auth | โ | OAuth only |
Works offline | โ | โ |
Reference tracking | โ | โ |
Document diff | โ | โ |
Bulk transactions | โ | โ |
Draft status | โ | โ |
Revision history | โ | โ |
Schema discovery | โ | โ |
Full CRUD | โ | โ |
GROQ queries | โ | โ |
Release management | โ | โ |
Semantic search | โ | โ |
tl;dr: We're better for self-hosting, developer tooling, and content operations. They're better if you need releases and semantic search with embeddings.
License
MIT ยฉ Purple Horizons
Links
Available Tools
18 toolssanity_bulkA
Execute multiple operations in a single atomic transaction. All succeed or all fail together.
| Name | Required | Description | Default |
|---|---|---|---|
| operations | Yes | Array of operations: create, createOrReplace, patch, or delete | |
| dryRun | No | If true, validate operations without executing them |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden for behavioral disclosure. It mentions atomicity and all-or-nothing execution but omits other important traits such as order of operations, dependency handling, error details, or required permissions. This leaves significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that immediately conveys the tool's core purpose. It is front-loaded and contains no filler, making it easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has only 2 parameters and no output schema, the description provides a functional overview. However, it lacks details on execution order, constraints, or expected behavior of operations, which could lead to misuse in complex scenarios.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description does not add any extra meaning beyond what is already provided in the schema's parameter descriptions. Parameter information is adequate but not enhanced.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool executes multiple operations atomically, distinguishing it from single-operation siblings like sanity_create and sanity_delete. The verb 'Execute' and resource 'multiple operations' are specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies that the tool should be used when atomicity is needed across multiple operations, but does not explicitly state when not to use it or provide alternatives (e.g., using individual operations). Thus, the usage guidance is implied rather than explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_countB
Count documents matching a GROQ filter
| Name | Required | Description | Default |
|---|---|---|---|
| filter | Yes | GROQ filter expression (e.g., "*[_type == 'post']") | |
| params | No | Optional parameters for the filter |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It only states the operation (count) but does not disclose behavior like performance, rate limits, or side effects. It implies a read operation but lacks explicit safety or destructive hints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence of 5 words with no waste. However, it could include a bit more context without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 2 parameters, no output schema, and no annotations, the description is incomplete. It fails to hint at return format (e.g., integer count) or provide usage examples, leaving an agent uncertain about the tool's full behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with both 'filter' and 'params' having descriptions in the schema. The tool description adds no extra meaning beyond what the schema already provides, earning a baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Count documents matching a GROQ filter' clearly specifies the action (count) and resource (documents with GROQ filter). It distinguishes from siblings like sanity_query (which returns documents) and sanity_list_documents (which lists documents).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide any guidance on when to use this tool versus alternatives, such as when to count versus query or list documents. No exclusions or contextual hints are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_createB
Create a new document in Sanity CMS. Requires write token.
| Name | Required | Description | Default |
|---|---|---|---|
| _type | Yes | The document type (e.g., "post", "author") | |
| _id | No | Optional: Custom document ID. If not provided, Sanity generates one. | |
| document | Yes | The document data (all fields except _type and _id) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must fully disclose behavioral traits. It only states 'Requires write token', which is useful but insufficient. It omits details about success responses, error conditions, side effects (e.g., validation, default values), or any irreversible actions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two succinct sentences with no wasted words. It front-loads the core purpose in the first sentence, making it highly scannable.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of an output schema, the description should explain return values (e.g., the created document ID) to compensate. It also does not address the nested 'document' object's structure or defaults, which would be valuable for an AI agent. For a create tool with many siblings, more contextual guidance is needed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters. The description adds no additional meaning beyond the schema, such as formatting hints, relationships between parameters, or typical patterns. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Create' and the resource 'a new document in Sanity CMS', explicitly distinguishing it from sibling tools like sanity_delete (delete), sanity_update (update), and sanity_patch (patch).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when creating a new document and mentions the requirement of a write token as a prerequisite. However, it does not provide guidance on when to use this tool over alternatives like sanity_bulk or sanity_publish, nor does it mention when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_deleteB
Delete a document. Requires write token.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The document ID to delete |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description only states 'Delete a document' and token requirement. Does not disclose permanence, reversibility, or side effects like cascade deletions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, action first, then token requirement. No extraneous text, very efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-param tool, description covers basic purpose and prerequisite. Lacks details on return value and irreversible nature, but minimally adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 100% coverage with one parameter described as 'The document ID to delete'. Description adds 'Requires write token' but no additional param meaning beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the tool deletes a document, distinguishing it from update (patch) or create operations. Specifies the action and resource.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Only mentions 'Requires write token' as a prerequisite. No guidance on when to prefer delete over unpublish or other alternatives, nor when not to use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_diffA
Compare two documents and see what fields differ. Useful for comparing draft vs published or two versions.
| Name | Required | Description | Default |
|---|---|---|---|
| idA | Yes | First document ID | |
| idB | Yes | Second document ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must convey behavioral traits. It correctly indicates a read-only operation (comparing documents), but it does not discuss authorization requirements, side effects, or output specifics. The description is adequate but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with two sentences, no redundant information, and the primary action is front-loaded. Every word serves a purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity and well-documented parameters (100% coverage), the description provides enough information for an agent to understand its purpose and usage. It could mention the output format, but it is not critical for this diff function.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with clear parameter descriptions ('First document ID', 'Second document ID'). The description does not add meaningful semantics beyond the schema, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly specifies the action ('compare two documents and see what fields differ') and provides concrete use cases ('draft vs published or two versions'), effectively distinguishing it from other Sanity tools like sanity_query or sanity_patch.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool by mentioning 'useful for comparing draft vs published or two versions', but it does not explicitly state when not to use it or mention alternative tools. This is clear context without exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_draft_statusA
Check if a document has unpublished changes. Shows both draft and published versions if they exist.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The document ID (with or without drafts. prefix) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the full burden. It discloses that both draft and published versions are shown if they exist, which is key behavioral information. However, it does not explicitly state that the operation is read-only or any other side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence of 13 words. It is front-loaded with the core purpose and contains no unnecessary information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple single-parameter tool with no output schema, the description adequately covers the purpose and behavior. It distinguishes between draft and published versions, which is important. It could mention the return format, but overall it is complete enough.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage for the single parameter 'id' is 100%. The description does not add any additional meaning beyond the schema's description of the parameter format, so it meets the baseline without exceeding it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Check if a document has unpublished changes') and the resource ('draft and published versions'). It effectively differentiates from siblings like sanity_diff, sanity_get_document, and sanity_publish/unpublish by focusing specifically on the draft status check.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for checking unpublished changes but does not explicitly state when to use this tool versus alternatives. With 17 sibling tools, more explicit guidance would improve clarity, but the context is sufficient for basic understanding.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_get_documentB
Get a single Sanity document by its ID
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The document ID (e.g., "post-123" or a Sanity-generated ID) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully describe behavior. While it indicates a read operation, it does not disclose what happens if the document ID is invalid, missing, or if there are authorization requirements. The agent is left guessing error behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, no filler, and directly conveys the essential purpose. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple get operation with one parameter, the description covers the core function. However, within the context of many sibling tools, it could mention that this is for single document retrieval by ID, and could hint at error behavior. Still, it is largely complete for its simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the schema already describes the 'id' parameter adequately with examples. The tool description adds no extra semantic value beyond what the schema provides, so baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Get' and the resource 'single Sanity document by its ID', which is specific and distinguishes it from sibling tools like sanity_list_documents (list) and sanity_search (search). No ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. Given 18 sibling tools including sanity_list_documents and sanity_search, a statement like 'Use when you have a specific document ID; for multiple documents, use sanity_list_documents' would be helpful.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_get_type_infoA
Get information about a document type including field names and document count
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | The document type to get info for |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses the output (field names and document count) but does not mention authentication, rate limits, or side effects. It is a read operation, so lack of safety warnings is acceptable but could be more explicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no fluff. It is front-loaded with the verb and resource, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity of the tool (one parameter, no output schema), the description adequately covers the return values (field names and count). However, it could be improved by specifying the structure (e.g., list of fields, count as integer).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already describes the single parameter 'type' with good coverage (100%). The description adds no extra meaning to the parameter itself, only hinting at the output. Baseline 3 is appropriate as the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states the tool retrieves information about a document type, including field names and document count. This clearly differentiates it from siblings like 'sanity_get_types' (which likely lists all types) and other CRUD tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use when needing metadata about a specific type, but does not explicitly state when not to use it or provide alternatives. However, the context is clear given the sibling list and the purpose is well-defined.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_get_typesA
Get all document types in the Sanity dataset
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so description carries full burden. It does not disclose read-only nature, authentication needs, rate limits, or any side effects. Minimal behavioral info.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, no wasted words. Front-loaded with key action and resource.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Simple tool with no params or output schema. Description could mention output format (e.g., list of strings or objects) to improve completeness. Adequate but not enriched.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters (0 params, 100% schema coverage). Baseline of 4 applies as description adds no param info, but none is needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool retrieves all document types in the Sanity dataset, using a specific verb ('Get') and resource ('all document types'). It distinguishes from siblings like sanity_get_type_info by focusing on all types rather than a specific one.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives (e.g., sanity_get_type_info for single type details). No context on prerequisites or exclusions provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_historyB
Get the revision history of a document. See who changed what and when.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The document ID | |
| limit | No | Maximum number of revisions to return (default: 25) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries full responsibility for behavioral disclosure. It hints that each revision includes author and timestamp ('who changed what and when'), but omits important behaviors such as pagination, ordering of revisions, inclusion of deleted documents, and required permissions. This leaves significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with purpose. Every sentence adds value with no filler. Slightly more detail would be acceptable, but it is appropriately concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple history retrieval tool with full schema coverage and no output schema, the description covers the basic purpose but lacks details on output format, pagination behavior (limit order), and permission requirements. It is adequate but not fully thorough.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for both parameters (id and limit). The description adds context about response content (authors, timestamps) but does not elaborate on parameter meaning beyond what the schema provides. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Get the revision history of a document. See who changed what and when.' It identifies the resource (revision history) and the specific verb (get), and adds context about the content of the history (who, what, when). This distinguishes it from siblings like sanity_get_document (current version) and sanity_diff (comparison of specific revisions).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use when revision history is needed, but does not explicitly state when to use this tool versus alternatives like sanity_get_document or sanity_diff. No exclusions or alternative pointers are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_list_documentsA
List documents of a specific type with pagination
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | The document type (e.g., "post", "author", "category") | |
| limit | No | Maximum number of documents to return (default: 20, max: 100) | |
| offset | No | Number of documents to skip (for pagination) | |
| order | No | Order clause (e.g., "_createdAt desc", "title asc") |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It indicates a read operation but does not disclose details like authentication needs, rate limits, or whether returned documents include drafts or only published. For a simple list, it is adequate but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence with no unnecessary words. It efficiently conveys the core functionality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity and full schema coverage, the description is mostly complete for a list operation. It could mention the return format or that it respects permissions, but it is still adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
All four parameters have descriptions in the schema (100% coverage). The description adds no additional meaning beyond what the schema provides, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb (List) and resource (documents of a specific type), and explicitly mentions pagination. It distinguishes itself from sibling tools like sanity_query and sanity_search by focusing on type-based listing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies its use for listing documents by type with pagination but provides no explicit guidance on when to use this tool versus alternatives like sanity_search or sanity_query. No exclusions are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_patchC
Partially update a document. Requires write token.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The document ID to patch | |
| set | No | Fields to set or update | |
| unset | No | Field names to remove | |
| inc | No | Numeric fields to increment | |
| dec | No | Numeric fields to decrement |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description must cover behavioral traits. It mentions partial update and write token requirement, but fails to disclose potential destructive effects, atomicity, or concurrency behavior. The description adds minimal value beyond the basic purpose.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with two short sentences, containing no wasted words. It is front-loaded with the primary action and followed by the essential prerequisite.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 5 parameters, no output schema, and 17 siblings, the description is too minimal. It does not explain how partial update works, the role of each parameter, or how to choose this tool over sanity_update, making it incomplete for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds nothing beyond the schema; it does not explain parameter syntax, relationships, or usage constraints. Thus, it scores at the baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool does a partial update on a document, which is a specific verb and resource. It distinguishes from siblings like sanity_create or sanity_delete, but does not explicitly differentiate from sanity_update, which likely performs full updates.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The only guidance is 'Requires write token,' which is a prerequisite. There is no information on when to use this tool versus alternatives such as sanity_update (full update) or sanity_publish, leaving the agent without clear context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_publishA
Publish a draft document (moves from drafts.* to published). Requires write token.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The draft document ID (with or without "drafts." prefix) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. Description only adds 'Requires write token' as behavioral info. Does not disclose error handling, idempotency, or state effects beyond the move.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences: one for purpose and effect, one for auth requirement. No fluff, front-loaded key action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple publish operation with one parameter, the description covers action, effect, and auth need. Missing return value info but no output schema exists to compensate. Adequate for low complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for the single parameter. Description adds no further semantics to the parameter beyond what the schema already states about the 'drafts.' prefix.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the verb 'Publish' and resource 'draft document', with explicit effect 'moves from drafts.* to published'. Distinguishes from siblings like sanity_unpublish by its action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies usage for publishing drafts but provides no explicit when-to-use or when-not-to-use guidance. With 17 sibling tools, lacks differentiation criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_queryB
Execute a GROQ query against Sanity CMS. GROQ is a query language similar to GraphQL but designed for JSON documents. Examples: *[_type == "post"] gets all posts, *[_type == "post" && slug.current == "my-post"][0] gets a specific post.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The GROQ query to execute | |
| params | No | Optional parameters for the query (referenced as $paramName in query) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It does not state whether the query is read-only, whether it can mutate data, or any auth/rate limit context. The examples imply querying but safety profile is unclear.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with 2-3 sentences and examples, front-loading the main action. Every part is relevant, though the example could be more compact.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, so the description should clarify return structure (e.g., array of documents). It also lacks mention of potential performance implications or error conditions. Given the tool's complexity, this is incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for both parameters. The description adds value with GROQ examples for the 'query' parameter (e.g., `*[_type == "post"]`), but for 'params' it only repeats schema info. Baseline 3 is appropriate as description enhances understanding somewhat.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it executes a GROQ query against Sanity CMS, with the verb 'Execute' and resource 'GROQ query'. Examples illustrate its use, and it distinctly differs from siblings that are more specific (e.g., sanity_search, sanity_list_documents).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions GROQ's similarity to GraphQL and provides examples, but does not explicitly guide when to use this tool over others (e.g., sanity_search for text search) or when not to use it. There is no mention of prerequisites or limitations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_referencesA
Find all documents that reference a given document. Essential before deleting to avoid broken references.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The document ID to find references to | |
| limit | No | Maximum number of referencing documents to return (default: 100) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It states the core function but omits details like whether full documents or IDs are returned, pagination behavior beyond the limit parameter, or required permissions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences: first defines purpose, second adds importance. No superfluous words, perfectly front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite lacking output schema and annotations, the description adequately explains the tool's purpose and use case. It could be more complete by describing the output format, but the essential information is present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% with both id and limit already described. The description does not add meaning beyond the schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Find' and the resource 'documents that reference a given document', distinguishing it from siblings like sanity_delete and sanity_list_documents by highlighting its specific purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context by noting it is 'Essential before deleting to avoid broken references', but does not explicitly mention when not to use it or name alternative tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_searchB
Search for documents using full-text search across titles, names, descriptions, and body content
| Name | Required | Description | Default |
|---|---|---|---|
| searchTerm | Yes | The search term | |
| types | No | Optional: Limit search to specific document types | |
| limit | No | Maximum number of results (default: 20) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It only mentions full-text search across fields, but fails to disclose read-only nature, performance, pagination behavior, or any side effects. Minimal transparency for a search tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence with clear structure, no redundancy. Efficiently conveys core functionality without superfluous words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a basic search tool with 3 parameters and no output schema. Missing details on return format, sorting, or fuzzy matching, but sufficient for typical use. Could improve with usage context or expected output.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 100% parameter coverage, but the description adds value by specifying that searchTerm applies to titles, names, descriptions, and body content. This enriches parameter understanding beyond the schema's 'The search term'. Above baseline due to added context.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the verb 'Search' and resource 'documents', specifying fields searched (titles, names, descriptions, body content). It distinguishes from sibling tools like sanity_list_documents and sanity_query by emphasizing full-text search across specific fields, though not explicitly contrasting with them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like sanity_query or sanity_list_documents. The description only states what it does without providing context for selection or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_unpublishA
Unpublish a document (moves to drafts.*). Requires write token.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The published document ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It discloses the core behavior (moves to drafts) and a prerequisite, but does not mention idempotency, error cases (e.g., already unpublished), or side effects (e.g., affects drafts).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences with front-loaded action and prerequisite. Every word earns its place; no fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description covers the essential purpose and a key prerequisite. Lacks details about return values or confirmation, but overall sufficient for the complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema description coverage, the schema already documents the 'id' parameter as 'The published document ID.' The description adds no additional meaning beyond that.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('unpublish'), the resource ('document'), and the effect ('moves to drafts.*'). This distinguishes it from sibling tools like sanity_publish or sanity_create.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The only guidance is 'Requires write token,' which is a prerequisite. No mention of when to use this tool vs. alternatives (e.g., sanity_delete, sanity_patch), nor any scenarios where it should not be used.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sanity_updateA
Replace an entire document. Requires write token.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The document ID to update | |
| document | Yes | The complete document data (will replace existing) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses the need for a write token but does not elaborate on side effects, reversibility, or whether the document is completely overwritten (implied). Adequate but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no wasted words. The action is front-loaded, and every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and two parameters, the description is minimal. It covers the core action and auth, but lacks details on the document object structure or expected response, which could affect completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already describes both parameters. The description adds no extra meaning beyond the schema, achieving the baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Replace an entire document' โ a specific verb (replace) and resource (document). It distinguishes from siblings like sanity_patch (partial update) and sanity_create.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Only mentions 'Requires write token' as a prerequisite, but provides no guidance on when to use this tool versus alternatives like sanity_patch for partial updates or sanity_create for new documents.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Every tool has a clearly distinct purpose: create, update, patch, delete, publish, unpublish, query, search, list, get, diff, history, references, etc. No two tools overlap in functionality.
All tools follow a consistent 'sanity_verb_noun' pattern using snake_case, e.g., sanity_create, sanity_publish, sanity_list_documents. No mixed conventions.
18 tools is slightly above the ideal 3-15 range, but the scope of a CMS (CRUD, publishing, search, history, diffs) justifies the count. Still reasonable.
The toolset covers the full document lifecycle: CRUD, patch, publish/unpublish, query, search, history, diffs, references, bulk operations, and type introspection. No obvious gaps.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
A hosted MCP server for planning, scheduling, media, analytics, and social publishing.
MCP server for InsForge BaaS โ database, storage, edge functions, and deployments
A MCP server built for developers enabling Git based project management with project and personalโฆ
Related MCP Servers
AlicenseAqualityAmaintenanceLocal-first MCP server for AI content governance. 13 tools for model/content management, validation, normalization, and i18n across any framework.224MIT- AlicenseBqualityCmaintenanceA production-grade MCP server for secure MongoDB CRUD operations with filtering, pagination, health monitoring, and rate limiting.41MIT
- AlicenseNot gradedqualityBmaintenanceOpen-source MCP server that turns any CMS backend into an AI-agent-ready content management system. It provides tools for content CRUD, idea management, and publication tracking, with safety features requiring human approval for publishing.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for uploading local images to Sanity CMS. Enables AI assistants to upload files from your filesystem directly into Sanity as image assets.611MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Purple-Horizons/sanity-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server