Skip to main content
Glama

๐Ÿ”ฎ 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.

npm version License: MIT


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-mcp

Or install globally:

npm install -g @purple-horizons/sanity-mcp

MCP 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

sanity_query

Execute any GROQ query

sanity_get_document

Fetch a single document by ID

sanity_list_documents

List documents by type with pagination

sanity_search

Full-text search across content

sanity_get_types

Discover all document types

sanity_get_type_info

Get schema info for a type

sanity_count

Count documents matching a filter

โœ๏ธ Write Operations

Tool

Description

sanity_create

Create a new document

sanity_update

Replace an entire document

sanity_patch

Partially update specific fields

sanity_delete

Delete a document

sanity_publish

Publish a draft

sanity_unpublish

Move published to draft

๐Ÿš€ Unique Tools (Not in Sanity's Official MCP)

Tool

Description

sanity_references

Find all documents referencing a given doc โ€” essential before deleting

sanity_diff

Compare two documents โ€” draft vs published, or any two docs

sanity_history

Get revision history โ€” see who changed what

sanity_bulk

Atomic batch operations โ€” all succeed or all fail

sanity_draft_status

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 image

Sanity'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 differ

See 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

SANITY_PROJECT_ID

โœ…

โ€”

Your Sanity project ID

SANITY_DATASET

โŒ

production

Dataset name

SANITY_TOKEN

โŒ

โ€”

API token (required for writes)

SANITY_API_VERSION

โŒ

2024-01-20

API version

Getting Your Token

  1. Go to sanity.io/manage

  2. Select your project โ†’ API โ†’ Tokens

  3. Add new token with Editor or higher permissions

  4. 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 dev

Comparison

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


Available Tools

18 tools
sanity_bulkA

Execute multiple operations in a single atomic transaction. All succeed or all fail together.

ParametersJSON Schema
NameRequiredDescriptionDefault
operationsYesArray of operations: create, createOrReplace, patch, or delete
dryRunNoIf true, validate operations without executing them

TDQS

A3.5/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
filterYesGROQ filter expression (e.g., "*[_type == 'post']")
paramsNoOptional parameters for the filter

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
_typeYesThe document type (e.g., "post", "author")
_idNoOptional: Custom document ID. If not provided, Sanity generates one.
documentYesThe document data (all fields except _type and _id)

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe document ID to delete

TDQS

B3.3/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idAYesFirst document ID
idBYesSecond document ID

TDQS

A4/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe document ID (with or without drafts. prefix)

TDQS

A4/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe document ID (e.g., "post-123" or a Sanity-generated ID)

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
typeYesThe document type to get info for

TDQS

A4/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.5/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe document ID
limitNoMaximum number of revisions to return (default: 25)

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
typeYesThe document type (e.g., "post", "author", "category")
limitNoMaximum number of documents to return (default: 20, max: 100)
offsetNoNumber of documents to skip (for pagination)
orderNoOrder clause (e.g., "_createdAt desc", "title asc")

TDQS

A3.8/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe document ID to patch
setNoFields to set or update
unsetNoField names to remove
incNoNumeric fields to increment
decNoNumeric fields to decrement

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe draft document ID (with or without "drafts." prefix)

TDQS

A3.6/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe GROQ query to execute
paramsNoOptional parameters for the query (referenced as $paramName in query)

TDQS

B3.3/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe document ID to find references to
limitNoMaximum number of referencing documents to return (default: 100)

TDQS

A4/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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_unpublishA

Unpublish a document (moves to drafts.*). Requires write token.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe published document ID

TDQS

A3.6/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idYesThe document ID to update
documentYesThe complete document data (will replace existing)

TDQS

A3.5/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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

A3.7/5.0
Disambiguation5/5

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.

Naming Consistency5/5

All tools follow a consistent 'sanity_verb_noun' pattern using snake_case, e.g., sanity_create, sanity_publish, sanity_list_documents. No mixed conventions.

Tool Count4/5

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.

Completeness5/5

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

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

Latest Blog Posts

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