> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to the Sanity MCP server

The Sanity MCP connector routes your AI agent's tool calls to Sanity's own MCP server through Scalekit. Each user signs in to Sanity once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 61 tools.

**Authentication:** OAuth 2.1/DCR
**Categories:** Developer Tools, Files & Documents, Productivity
**Tools:** 61: 18 read, 37 write, 6 destructive
**Users sign in with:** OAuth
**OAuth app:** Scalekit's or your own
**Built by:** Vendor MCP
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=SANITYMCP)

## What you can do

- **Query content**: run GROQ queries and semantic searches to find documents in a dataset
- **Create and edit documents**: create drafts from structured content, JSON, or Markdown, patch documents, and generate images with AI
- **Publish content**: publish, unpublish, and discard drafts, and group changes into content releases
- **Manage schemas and datasets**: read and deploy schemas, and create, list, and update datasets
- **Work with projects and Studios**: list organizations and projects, create projects, and deploy Sanity Studio
- **Search Sanity docs**: search and read Sanity documentation and migration guides

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Sanity MCP connection

   In **AgentKit > Connections**, create a Sanity MCP connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

   Scalekit credentials are available for Sanity MCP server, so you don't need to register an OAuth app.

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'sanitymcp'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Sanity MCP:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'sanitymcp_whoami',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "sanitymcp"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Sanity MCP:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="sanitymcp_whoami",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user signs in once. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'sanitymcp__get_ui_context',
  toolInput: {
    dataset: '<dataset>',
    projectId: '<projectId>',
  },
  connector: 'sanitymcp',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="sanitymcp__get_ui_context",
    tool_input={
        "dataset": "<dataset>",
        "projectId": "<projectId>",
    },
    connection_name="sanitymcp",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `sanitymcp__get_ui_context`

Get Ui Context · Read-only

Get the current UI context including the active document and workspace in Sanity Studio.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `documentId` (`string`, optional): The document ID to fetch context for. When omitted, returns project-level context only (studio URL).
- `documentType` (`string`, optional): The document _type. When provided, the tool skips fetching the document to infer its type.
- `maxRefDepth` (`integer`, optional): Maximum depth for collecting reference IDs from the document (default 2)
- `workspaceName` (`string`, optional): Exact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".

Example input: `{"dataset":"<dataset>","projectId":"<projectId>"}`

### `sanitymcp_cors_origins_list`

List CORS Origins · Read-only

Lists all CORS origins configured for a Sanity project.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"projectId":"<projectId>"}`

### `sanitymcp_get_document`

Get Document · Read-only

Retrieve a single Sanity document by its ID.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `documentId` (`string`, required): The exact document ID to fetch. Must be a complete, known document ID (e.g., "movie-123" or "drafts.article-456"). This is a direct ID lookup only - it does not search, filter, or query.
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","documentId":"movie-123","projectId":"<projectId>"}`

### `sanitymcp_get_project_studios`

Get Project Studios · Read-only

List all Sanity Studios deployed for a project.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"projectId":"<projectId>"}`

### `sanitymcp_get_sanity_rules`

Get Sanity Rules · Read-only

Load one or more Sanity content rules by name.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `rules` (`array`, required): One or more rule names to load. Use list_sanity_rules to see available rules.
- `intent` (`string`, optional): Brief description of what you are trying to accomplish.

Example input: `{"rules":[]}`

### `sanitymcp_get_schema`

Get Schema · Read-only

Retrieve the schema for a specific document type in a workspace.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `schemaId` (`string`, optional): Deprecation notice: schemaId for schema selection is deprecated, Sanity is moving to one authoritative schema per dataset. During the deprecation period, schemaId is still supported for selecting an exact legacy schema source. Legacy exact schema source selector. Omit to use the authoritative schema for the dataset.
- `type` (`string`, optional): Optional: Specific type name to fetch. If not provided, returns the full schema without detailed field definitions. Full field definitions are only available when requesting a specific type.
- `workspaceName` (`string`, optional): Deprecation notice: workspaceName for schema selection is deprecated, Sanity is moving to one authoritative schema per dataset. Consolidate competing schemas and resolve conflicts explicitly before migrating. During the deprecation period, workspaceName is still supported. Omit workspaceName for the sole active or default schema, or provide it when selecting another workspace. Legacy schema workspace selector. Omit to use the sole deployed schema source, or default when there are multiple or none.

Example input: `{"dataset":"<dataset>","projectId":"<projectId>"}`

### `sanitymcp_list_datasets`

List Datasets · Read-only

List all datasets in a Sanity project.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"projectId":"<projectId>"}`

### `sanitymcp_list_embeddings_indices`

List Embeddings Indices · Read-only

List all embeddings indices available in a Sanity project.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","projectId":"<projectId>"}`

### `sanitymcp_list_organizations`

List Organizations · Read-only

List all Sanity organizations the authenticated user belongs to.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `intent` (`string`, optional): Brief description of what you are trying to accomplish.

Example input: `{}`

### `sanitymcp_list_projects`

List Projects · Read-only

List all Sanity projects the authenticated user has access to.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `intent` (`string`, optional): Brief description of what you are trying to accomplish.

Example input: `{}`

### `sanitymcp_list_releases`

List Releases · Read-only

List content releases for a project with optional state filtering and pagination.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `limit` (`integer`, optional): Maximum number of releases to return. Default: `10`.
- `offset` (`integer`, optional): Number of releases to skip for pagination. Default: `0`.
- `state` (`string`, optional): Filter releases by state. If omitted, returns active and scheduled releases (excludes published and archived). One of: `active`, `scheduled`, `published`, `archived`.

Example input: `{"dataset":"<dataset>","projectId":"<projectId>"}`

### `sanitymcp_list_sanity_rules`

List Sanity Rules · Read-only

List all available Sanity content rule names.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `intent` (`string`, optional): Brief description of what you are trying to accomplish.

Example input: `{}`

### `sanitymcp_list_workspace_schemas`

List Workspace Schemas · Read-only

List all schema types defined in a Sanity workspace.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","projectId":"<projectId>"}`

### `sanitymcp_query_documents`

Query Documents · Read-only

Execute a GROQ query against the Sanity dataset and return matching documents.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `query` (`string`, required): Complete GROQ query. Select only needed fields and slice arrays to keep responses small. For example: *[_type == "post"] | order(_id asc)[0...100]{_id, title}. For later pages, add _id > $after to the filter, passing the previous page’s last _id in params. Slice large nested arrays too.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `params` (`object`, optional): Optional parameters for the GROQ query as a JSON object
- `perspective` (`string`, optional): Optional perspective to query from: "raw", "drafts", "published", or a release ID. Models should examine available releases and perspectives in the dataset before selecting one to ensure they are querying from the most appropriate view of the content. Default: `raw`.

Example input: `{"dataset":"<dataset>","projectId":"<projectId>","query":"*[_type == \\"}`

### `sanitymcp_read_docs`

Read Docs · Read-only

Read a Sanity documentation page by URL or path.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `path` (`string`, optional): Path to the documentation page (e.g., "/docs/studio/installation" or "/changelog/studio-Ni41LjA")
- `url` (`string`, optional): Full URL to the documentation page (e.g., "https://www.sanity.io/docs/studio/installation")

Example input: `{}`

### `sanitymcp_search_docs`

Search Docs · Read-only

Search Sanity documentation by keyword query.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `query` (`string`, required): GROQ query string to execute.
- `intent` (`string`, optional): Brief description of what you are trying to accomplish.
- `limit` (`integer`, optional): Maximum number of items to return. Default: `10`.

Example input: `{"query":"*[_type == \\"}`

### `sanitymcp_semantic_search`

Semantic Search · Read-only

Perform a semantic similarity search against a Sanity embeddings index.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `indexName` (`string`, required): The name of the embeddings index to search
- `projectId` (`string`, required): The Sanity project ID
- `query` (`string`, required): The search query to find semantically similar content
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `limit` (`integer`, optional): Maximum number of results to return. Default: `10`.

Example input: `{"dataset":"<dataset>","indexName":"<indexName>","projectId":"<projectId>","query":"*[_type == \\"}`

### `sanitymcp_whoami`

Whoami · Read-only

Get the currently authenticated Sanity user profile.

Read only: yes. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `intent` (`string`, optional): Brief description of what you are trying to accomplish.

Example input: `{}`

### `sanitymcp_add_cors_origin`

Add Cors Origin · Write

Add a CORS origin to allow browser-based API access for a Sanity project.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `origin` (`string`, required): CORS origin to allow, in format protocol://hostname[:port].

Wildcards (*) are supported for subdomains (e.g., https://*.example.com).
The unrestricted wildcard (*) always disables credentials.

Common values:
- http://localhost:3000: Local development with Next.js, React, etc.
- http://localhost:3333: Standalone Sanity Studio
- https://*.lovable.app: Lovable preview and published apps
- https://*.figma.site: Figma Make apps
- https://*.vusercontent.net: v0 preview iframes
- https://*.vercel.app: v0 published apps
- https://*.local-credentialless.webcontainer-api.io: Bolt preview
- https://*.bolt.host: Bolt published apps
- https://your-domain.com: Your production domain
- `projectId` (`string`, required): The Sanity project ID
- `allowCredentials` (`boolean`, optional): Allow authenticated requests from this origin. Required for hosting a Studio or making authenticated API requests. Defaults to true. Always false when origin is `*`. Default: `true`.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"origin":"<origin>","projectId":"<projectId>"}`

### `sanitymcp_assets_upload_status`

Assets Upload Status · Write

Check one to 20 asset uploads using operationIds. Wait at least pollAfterMs between checks and group running uploads in one call. Honor HTTP Retry-After when rate limited. A status lookup error does not mean the upload failed. Results include asset IDs, URLs, and references; set includeMetadata for full metadata. Results are available for up to 24 hours. If an upload outcome is unknown, check the destination before repeating it.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `operationIds` (`array`, required): One to 20 operation IDs to check together. Poll only unfinished operations.
- `includeMetadata` (`boolean`, optional): Include full asset metadata. By default, return asset IDs, URLs, and document references.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"operationIds":[]}`

### `sanitymcp_create_dataset`

Create Dataset · Write

Create a new dataset in a Sanity project with the specified access control mode.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `datasetName` (`string`, required): The name of the dataset
- `projectId` (`string`, required): The Sanity project ID
- `aclMode` (`string`, optional): The ACL mode for the dataset. One of: `private`, `public`.
- `description` (`string`, optional): A brief description of the dataset purpose
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"datasetName":"<datasetName>","projectId":"<projectId>"}`

### `sanitymcp_create_documents`

Create Document(s) · Write

Create one or more draft documents by directly providing structured content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `documents` (`array`, required): Array of documents to create. Each document must have a type and content, with every document field inside content. Prefer Sanity-generated _id values by omitting _id from content unless a stable custom document ID is required. The entire request must fit within 100kb. Send fewer documents per call when writing large amounts of content.
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `releaseId` (`string`, optional): Optional release ID for creating versioned documents. If provided, documents will be created under the specified release version instead of as drafts or published liveEdit documents.
- `workspaceName` (`string`, optional): Deprecation notice: workspaceName for schema selection is deprecated, Sanity is moving to one authoritative schema per dataset. Consolidate competing schemas and resolve conflicts explicitly before migrating. During the deprecation period, workspaceName is still supported. Omit workspaceName for the sole active or default schema, or provide it when selecting another workspace. Exact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".

Example input: `{"dataset":"<dataset>","documents":[],"projectId":"<projectId>"}`

### `sanitymcp_create_project`

Create Project · Write

Create a new Sanity project with optional CORS origin and organization.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `displayName` (`string`, required): Display name for the Sanity project.
- `organizationId` (`string`, required): Sanity organization ID to create the project under.
- `allowCredentials` (`boolean`, optional): Whether to allow credentials (cookies) from this CORS origin. Default: `true`.
- `corsOrigin` (`string`, optional): CORS origin URL for the new project.
- `intent` (`string`, optional): Brief description of what you are trying to accomplish.

Example input: `{"displayName":"<displayName>","organizationId":"<organizationId>"}`

### `sanitymcp_create_release`

Create Release · Write

Create a new content release for scheduling or grouping document publications.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `title` (`string`, required): Human-readable title for the release (e.g. "Q1 2024 Product Updates")
- `description` (`string`, optional): Optional description of the release
- `intendedPublishAt` (`string`, optional): ISO 8601 date for when the release is intended to be published. Only relevant for "scheduled" release type. Recorded as metadata only — the release is not scheduled, and list_releases will keep reporting state "active" with an empty publishAt until it is scheduled in Sanity Studio or via the HTTP Actions API.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `releaseId` (`string`, optional): Optional release ID, if omitted one is generated.
- `releaseType` (`string`, optional): Release type: "asap" to publish immediately when ready, "scheduled" for a specific date, or "undecided" (default). Recorded as intended-publish metadata only — "scheduled" does not schedule the release. One of: `asap`, `undecided`, `scheduled`. Default: `undecided`.

Example input: `{"dataset":"<dataset>","projectId":"<projectId>","title":"Q1 2024 Product Updates"}`

### `sanitymcp_create_version`

Create Version · Write

Create versioned copies of documents and associate them with a release.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `documentIds` (`array`, required): Array of document IDs to create versions for (min 1, max 10)
- `projectId` (`string`, required): The Sanity project ID
- `releaseId` (`string`, required): ID of the release to associate this version with
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","documentIds":[],"projectId":"<projectId>","releaseId":"<releaseId>"}`

### `sanitymcp_dataset_assets_upload_from_file`

Dataset Assets Upload From File · Write

Prepare a one-use URL for uploading an image or file up to 50 MiB to a Content Lake dataset. Works with browser-selected files, readable chat attachments, generated files, and local files. The client needs access to the bytes and HTTP POST capability; no shell or CLI is required. Prepare after the file is available. POST the raw bytes to uploadUrl before uploadExpiresAt. The HTTP response returns the document reference and an asset summary with its ID, type, URL, filename, MIME type, size, title, description, and image dimensions. Set includeMetadata to return the full asset document with all extracted metadata. If the upload response is lost, prepare a new upload URL and resend the same file bytes and upload parameters. For files in ChatGPT web, use `dataset_assets_upload_from_web_chatgpt`.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `assetType` (`string`, required): Upload as a dataset image or file asset. One of: `image`, `file`.
- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `creditLine` (`string`, optional): No description.
- `description` (`string`, optional): No description.
- `filename` (`string`, optional): Original filename, including extension. Not inferred from the source URL.
- `includeMetadata` (`boolean`, optional): Return the full asset document, including all extracted metadata, in the upload response. By default, the response returns a compact asset summary and the document reference.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `title` (`string`, optional): No description.

Example input: `{"assetType":"image","dataset":"<dataset>","projectId":"<projectId>"}`

### `sanitymcp_dataset_assets_upload_from_url`

Dataset Assets Upload From Url · Write

Start an image or file upload from a public HTTPS URL to a Content Lake dataset. Returns an operationId immediately; use assets_upload_status to retrieve the asset and document field reference. Attach the returned reference with patch_documents, preserving existing field values. Submit uploads individually and check their operation IDs together with assets_upload_status. Honor HTTP Retry-After when rate limited. If a request is interrupted before an operationId is returned, check the destination before repeating the upload. Source size and fetch time limits apply; processing may take several minutes. For a local or private file, use `dataset_assets_upload_from_file`. For files in ChatGPT web, use `dataset_assets_upload_from_web_chatgpt`.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `assetType` (`string`, required): Upload as a dataset image or file asset. One of: `image`, `file`.
- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `url` (`string`, required): Public HTTPS asset URL. Sanity fetches it without additional authentication headers.
- `creditLine` (`string`, optional): No description.
- `description` (`string`, optional): No description.
- `filename` (`string`, optional): Original filename, including extension. Not inferred from the source URL.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `label` (`string`, optional): No description.
- `meta` (`array`, optional): Metadata to extract. Omit to use the API defaults.
- `requestKey` (`string`, optional): Optional UUID for retrying an interrupted request. Omit to generate one automatically. Reuse a supplied UUID with identical arguments to retrieve the same upload. For changed arguments or a new attempt after failure, omit it or provide a new UUID.
- `source` (`object`, optional): External source attribution. Provide its name and asset ID together.
- `title` (`string`, optional): No description.

Example input: `{"assetType":"image","dataset":"<dataset>","projectId":"<projectId>","url":"https://www.sanity.io/docs/studio/installation"}`

### `sanitymcp_dataset_assets_upload_from_web_chatgpt`

Dataset Assets Upload From Web Chatgpt · Write

Upload a ChatGPT web attachment or generated file to a Content Lake dataset. Pass the file through ChatGPT web file input; ChatGPT web supplies a temporary download URL that Sanity fetches. Works when the ChatGPT web sandbox cannot make HTTP requests. Choose image or file as assetType. Returns an operationId; use assets_upload_status to retrieve the asset and document field reference. Attach the reference with patch_documents, preserving existing field values. If the download URL expires, pass the file again for a fresh URL and a new requestKey. Check the destination before repeating an upload whose outcome is unknown. Source size and fetch time limits apply; processing may take several minutes.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `assetType` (`string`, required): Upload as a dataset image or file asset. One of: `image`, `file`.
- `dataset` (`string`, required): The name of the dataset in the project
- `file` (`object`, required): ChatGPT web attachment or generated file. Pass the file using ChatGPT web file input.
- `projectId` (`string`, required): The Sanity project ID
- `creditLine` (`string`, optional): No description.
- `description` (`string`, optional): No description.
- `filename` (`string`, optional): Original filename, including extension. Not inferred from the source URL.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `label` (`string`, optional): No description.
- `meta` (`array`, optional): Metadata to extract. Omit to use the API defaults.
- `requestKey` (`string`, optional): Optional UUID for retrying an interrupted request. Omit to generate one automatically. Reuse a supplied UUID with identical arguments to retrieve the same upload. For changed arguments or a new attempt after failure, omit it or provide a new UUID.
- `source` (`object`, optional): External source attribution. Provide its name and asset ID together.
- `title` (`string`, optional): No description.

Example input: `{"assetType":"image","dataset":"<dataset>","file":{},"projectId":"<projectId>"}`

### `sanitymcp_deploy_schema`

Deploy Schema · Write

Deploy a schema declaration to a Sanity project workspace.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `schemaDeclaration` (`string`, required): Sanity schema declaration as a string of JS object literals.
<syntax>
- Requires literal values only: no spread operators, variables, dynamic expressions, imports, or function
   bodies
- If your schema makes references to other custom types in references, add those type declarations
  as well, or in a separate call to this tool first
- Multiple schema types can be declared in the same source string. Simply append the objects one after another
- This is JavaScript object-literal syntax, not JSON: use unquoted keys and do not wrap the objects in a `[ ]` array
- The schema declarations are not evaluated, so keep it declarative
- `preview` configuration is not currently supported and causes the request to fail before deployment
</syntax>
<example>

{
  name: 'author',
  type: 'document',
  fields: [
    {
      name: 'name',
      type: 'string',
    },
  ],
}

{
  name: 'article',
  type: 'document',
  fields: [
    {
      name: 'title',
      type: 'string',
      validation: (Rule) => Rule.required().max(100),
    },
    {
      name: 'slug',
      type: 'slug'
    },
    {
      name: 'body',
      type: 'array',
      of: [{type: 'block'}],
    },
    {
      name: 'author',
      type: 'reference',
      to: [{type: 'author'}],
    },
  ],
}

</example>
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `workspaceName` (`string`, optional): Exact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".

Example input: `{"dataset":"<dataset>","projectId":"<projectId>","schemaDeclaration":"<schemaDeclaration>"}`

### `sanitymcp_deploy_studio`

Deploy Studio · Write

Deploy a Sanity Studio to a hosted app subdomain.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `appHost` (`string`, required): Studio subdomain — globally unique across sanity.studio. The concrete URL is returned as `studioUrl` on success.
- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `title` (`string`, required): Human-facing title shown in Studio navigation.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `workspaceName` (`string`, optional): Exact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".

Example input: `{"appHost":"<appHost>","dataset":"<dataset>","projectId":"<projectId>","title":"Q1 2024 Product Updates"}`

### `sanitymcp_documents_validate`

Documents Validate · Write

Validate documents against the deployed schema without modifying them. This tool is in beta. Results may be incorrect or incomplete; review them before making changes.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `documentIds` (`array`, required): Exact IDs of the documents to validate, e.g. "drafts.article-1"
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `workspaceName` (`string`, optional): Workspace name as returned by `list_workspace_schemas`. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".

Example input: `{"dataset":"<dataset>","documentIds":[],"projectId":"<projectId>"}`

### `sanitymcp_generate_image`

Generate Image · Write

Generate an image for a document field using an AI instruction.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `documentId` (`string`, required): The ID of the document containing the image
- `imagePath` (`string`, required): Path to the image field in the document (e.g., "image", "hero.image", "images"). For arrays of images, provide the array field name and a new image will be added automatically.
- `instruction` (`string`, required): Natural language instructions for generating the image. Acts like a prompt telling the internal Sanity AI what to do. Describe the complete image to create (e.g., "A serene mountain landscape at dawn with misty valleys"). Keep instructions clear and specific for best results.
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `workspaceName` (`string`, optional): Deprecation notice: workspaceName for schema selection is deprecated, Sanity is moving to one authoritative schema per dataset. Consolidate competing schemas and resolve conflicts explicitly before migrating. During the deprecation period, workspaceName is still supported. Omit workspaceName for the sole active or default schema, or provide it when selecting another workspace. Exact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".

Example input: `{"dataset":"<dataset>","documentId":"movie-123","imagePath":"image","instruction":"A serene mountain landscape at dawn with misty valleys","projectId":"<projectId>"}`

### `sanitymcp_give_sanity_feedback`

Give Sanity Feedback · Write

Submit feedback about Sanity when you encounter issues while working with a Sanity codebase or project.
Use this when:
- A Sanity MCP tool returned an unexpected error or confusing result
- You needed a Sanity capability that doesn't exist or is hard to use
- Sanity docs, MCP tool descriptions, or examples were unclear or incorrect
- Common Sanity surfaces such as @sanity/client, the HTTP API, schemas, Studio, or deployment were confusing or blocked progress
- You had to use a workaround for something in Sanity that should be simpler

Provide a specific, detailed message about what you were trying to do,
what happened, and what you expected instead.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `message` (`string`, required): Describe the Sanity issue. Include: what you were trying to do, what you tried, and where you got stuck. Be specific — include MCP tool names, Sanity surface names such as @sanity/client, HTTP API, docs, Studio, or schemas, error messages, and parameter values when relevant.
- `category` (`string`, optional): Category of feedback to help with triage. One of: `tool_error`, `missing_capability`, `confusing_output`, `documentation`, `sanity_api`, `other`.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `mediaLibraryId` (`string`, optional): The Media Library ID this feedback relates to, if any — the `mediaLibraryId` you passed to a `media_library_*` tool.
- `organizationId` (`string`, optional): The organization ID this feedback relates to, if known. Media Libraries belong to an organization rather than a project.
- `projectId` (`string`, optional): The Sanity project ID this feedback relates to, if any. Leave unset for general feedback not tied to a specific project.
- `severity` (`string`, optional): How much this blocked progress. high = completely blocked, medium = workaround needed, low = minor. One of: `low`, `medium`, `high`. Default: `medium`.
- `toolName` (`string`, optional): The MCP tool this feedback is about, if any (e.g. "query_documents"). Leave unset for general Sanity feedback.

Example input: `{"message":"<message>"}`

### `sanitymcp_media_assets_upload_from_url`

Media Assets Upload From Url · Write

Deprecated. Use media_library_upload_from_url with the same arguments. This tool does not start an upload.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `mediaLibraryId` (`string`, required): Target Media Library ID.
- `url` (`string`, required): Public HTTPS asset URL. Sanity fetches it without additional authentication headers.
- `aspects` (`string`, optional): Aspect values for a new asset, up to 64 KiB of JSON. Cannot be combined with assetId.
- `assetId` (`string`, optional): Existing Media Library asset ID to add a new version to. Cannot be combined with aspects.
- `assetType` (`string`, optional): Optional type override. Omit to detect the type from the source content. One of: `image`, `video`, `file`.
- `autoGenerateTitle` (`boolean`, optional): Generate a title from image content during processing. Omit to use the filename. Cannot be combined with title, even when false.
- `cdnAccessPolicy` (`string`, optional): No description. One of: `public`, `private`.
- `filename` (`string`, optional): Original filename, including extension. Not inferred from the source URL.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `requestKey` (`string`, optional): Optional UUID for retrying an interrupted request. Omit to generate one automatically. Reuse a supplied UUID with identical arguments to retrieve the same upload. For changed arguments or a new attempt after failure, omit it or provide a new UUID.
- `sessionId` (`string`, optional): No description.
- `sha1` (`string`, optional): Expected SHA-1 hash for validation.
- `title` (`string`, optional): Asset title. Omit to use the filename. Cannot be combined with autoGenerateTitle.

Example input: `{"mediaLibraryId":"<mediaLibraryId>","url":"https://www.sanity.io/docs/studio/installation"}`

### `sanitymcp_media_library_create_documents`

Media Library Create Documents · Write

Create documents in a Media Library. Only `sanity.asset.collection` can be created — assets themselves come from uploading a binary, which is not supported here. Documents are created directly, not as drafts.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `documents` (`array`, required): Array of documents to create (max 25). Each document must have a type and content, with every document field inside content.
- `mediaLibraryId` (`string`, required): The Sanity Media Library ID (org-scoped, distinct from a project/dataset). Found in the Media Library URL or organization settings, or via `media_library_list`.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"documents":[],"mediaLibraryId":"<mediaLibraryId>"}`

### `sanitymcp_media_library_discard_drafts`

Media Library Discard Drafts · Write

Discard asset drafts, throwing away unpublished metadata edits and leaving the published asset intact.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `ids` (`array`, required): Asset IDs to discard unpublished metadata edits for (max 25).
- `mediaLibraryId` (`string`, required): The Sanity Media Library ID (org-scoped, distinct from a project/dataset). Found in the Media Library URL or organization settings, or via `media_library_list`.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"ids":[],"mediaLibraryId":"<mediaLibraryId>"}`

### `sanitymcp_media_library_get_document`

Media Library Get Document · Write

Fetch a single Media Library document by its exact ID. This is a direct ID lookup only - it does not search, filter, or query.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `documentId` (`string`, required): The exact document ID to fetch, e.g. an asset ID, or a `drafts.` prefixed ID for an asset with unpublished metadata edits.
- `mediaLibraryId` (`string`, required): The Sanity Media Library ID (org-scoped, distinct from a project/dataset). Found in the Media Library URL or organization settings, or via `media_library_list`.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"documentId":"movie-123","mediaLibraryId":"<mediaLibraryId>"}`

### `sanitymcp_media_library_get_schema`

Media Library Get Schema · Write

Get the document types of a Media Library, or the full field definitions for one type. Call this before querying or editing: the library schema is fixed (assets, collections, folders, aspects), and the organization's own asset aspects are merged onto `sanity.asset` under `aspects`.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `mediaLibraryId` (`string`, required): The Sanity Media Library ID (org-scoped, distinct from a project/dataset). Found in the Media Library URL or organization settings, or via `media_library_list`.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `type` (`string`, optional): Optional document type to get the full schema definition for, e.g. "sanity.asset". Omit for an overview of the available types.

Example input: `{"mediaLibraryId":"<mediaLibraryId>"}`

### `sanitymcp_media_library_link_assets`

Media Library Link Assets · Write

Make one or more Media Library assets usable in project documents. For image/file assets this creates a local deliverable copy and returns a field value referencing it, plus a weak `media` global document reference back to the library; for video assets it returns a `sanity.video` value with global document references only (no local copy). Returns per-asset ready-to-use field values to apply with `patch_documents` against the target dataset. Each field type must match its asset type. Pairs with `media_library_list_asset_references`.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The target dataset to link the assets into.
- `links` (`array`, required): The assets to link (max 25). Each is processed independently.
- `mediaLibraryId` (`string`, required): The Sanity Media Library ID (org-scoped, distinct from a project/dataset). Found in the Media Library URL or organization settings, or via `media_library_list`.
- `projectId` (`string`, required): The target project ID to link the assets into.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","links":[],"mediaLibraryId":"<mediaLibraryId>","projectId":"<projectId>"}`

### `sanitymcp_media_library_list`

Media Library List · Write

Lists the Sanity Media Libraries in an organization. Call `list_organizations` first to get an organization ID. Returns library IDs to pass as `mediaLibraryId` to the other `media_library_*` tools.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `organizationId` (`string`, required): The organization ID to list Media Libraries for (as returned by `list_organizations`).
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"organizationId":"<organizationId>"}`

### `sanitymcp_media_library_list_asset_references`

Media Library List Asset References · Write

Lists documents (across project datasets) that reference a Media Library asset. Use this before replacing an asset to see what depends on it.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `assetId` (`string`, required): The published asset container ID (`sanity.asset` `_id`, without a `drafts.` prefix) to find references for. References always point at the published asset.
- `mediaLibraryId` (`string`, required): The Sanity Media Library ID (org-scoped, distinct from a project/dataset). Found in the Media Library URL or organization settings, or via `media_library_list`.
- `cursor` (`string`, optional): Pagination cursor (`nextCursor`) from a previous response.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"assetId":"<assetId>","mediaLibraryId":"<mediaLibraryId>"}`

### `sanitymcp_media_library_patch_documents`

Media Library Patch Documents · Write

Edit Media Library documents. Edits are limited to the safe subset: an asset's `title` and `aspects.*`, its `cdnAccessPolicy`, and collection metadata/membership. Asset `title`/`aspects.*` edits are saved to a draft — publish them with `media_library_publish_documents`. `cdnAccessPolicy` is published-only and takes effect immediately: address it by the published id (a `drafts.` id is refused, since it cannot be staged) and patch it separately from title/aspects. Collections are edited directly. Folder placement, the version graph, and other system fields are rejected and must be managed in the Media Library app; custom metadata belongs in aspects. Every value an edit writes must be valid against the library's schema afterwards, on a draft or a published document alike; the edit is refused with the reasons otherwise. Problems the document already had elsewhere are reported as warnings, not enforced, and will stop publish until fixed. Array items without a `_key` are keyed by Content Lake on write, so re-read before addressing them by key.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `documents` (`object`, required): Map of document IDs to patch operations, up to 25 documents. Use the asset or collection ID; the tool decides whether the edit lands on the draft or the published document. To edit more than 25 documents, page through them with `media_library_query_documents` (order by `_id`, filter `_id > $last`, `totalAvailable` gives the count) and make one call per page; each call is independent, so a refused page leaves the others as they were.
- `mediaLibraryId` (`string`, required): The Sanity Media Library ID (org-scoped, distinct from a project/dataset). Found in the Media Library URL or organization settings, or via `media_library_list`.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"documents":{},"mediaLibraryId":"<mediaLibraryId>"}`

### `sanitymcp_media_library_publish_documents`

Media Library Publish Documents · Write

Publish asset drafts to make unpublished metadata edits (`title`, `aspects.*`) live, preserving published-only and system-managed fields. The draft is validated against the current aspect definitions first, as the Media Library app does: any error in `title` or `aspects` refuses the publish, an aspect whose definition has since been deleted is kept as it stands, and root fields outside the schema are preserved and listed. Only assets have a draft/publish flow. Fails for an asset that has no draft.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `ids` (`array`, required): Asset IDs to publish metadata edits for (max 25). Draft or published IDs both work.
- `mediaLibraryId` (`string`, required): The Sanity Media Library ID (org-scoped, distinct from a project/dataset). Found in the Media Library URL or organization settings, or via `media_library_list`.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"ids":[],"mediaLibraryId":"<mediaLibraryId>"}`

### `sanitymcp_media_library_query_documents`

Media Library Query Documents · Write

Query a Media Library using GROQ. Assets, collections, folders, and aspect definitions are all queryable. The result count reflects the query result set, not the library total; use a `count()` query for totals.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `mediaLibraryId` (`string`, required): The Sanity Media Library ID (org-scoped, distinct from a project/dataset). Found in the Media Library URL or organization settings, or via `media_library_list`.
- `query` (`string`, required): Complete GROQ query (e.g. "*[_type == \"sanity.asset\"][0...10]{_id, title}")
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `limit` (`integer`, optional): Maximum number of documents to return. Default: `10`.
- `params` (`object`, optional): Optional parameters for the GROQ query
- `perspective` (`string`, optional): Optional perspective to query from, as in `query_documents`: "raw" (the default) returns every document as stored, so an asset with unpublished metadata edits appears twice, as `drafts.{id}` and `{id}`; "drafts" is what the Media Library app shows, published assets with unpublished metadata edits applied, each asset once; "published" is live asset state only, what datasets and the CDN see. A Media Library has no releases. One of: `raw`, `drafts`, `published`. Default: `raw`.

Example input: `{"mediaLibraryId":"<mediaLibraryId>","query":"*[_type == \\"}`

### `sanitymcp_media_library_upload_from_file`

Media Library Upload From File · Write

Prepare a one-use URL to upload a local or private image, video, or file up to 50 MiB to a Media Library, or add a version to an existing asset. Requires access to the file bytes and the ability to make an HTTP POST. Follow the returned upload instructions.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `filename` (`string`, required): Original filename, including extension.
- `mediaLibraryId` (`string`, required): Target Media Library ID.
- `type` (`string`, required): Type of asset being uploaded. One of: `image`, `video`, `file`.
- `aspects` (`string`, optional): Aspect values for a new asset, up to 64 KiB of JSON. Cannot be combined with assetId.
- `assetId` (`string`, optional): Existing Media Library asset ID to add a new version to. Cannot be combined with aspects.
- `autoGenerateTitle` (`boolean`, optional): Generate a title from image content during processing. Omit to use the filename. Cannot be combined with title, even when false.
- `cdnAccessPolicy` (`string`, optional): No description. One of: `public`, `private`.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `sessionId` (`string`, optional): No description.
- `sha1` (`string`, optional): Expected SHA-1 hash for validation.
- `title` (`string`, optional): Asset title. Omit to use the filename. Cannot be combined with autoGenerateTitle.

Example input: `{"filename":"<filename>","mediaLibraryId":"<mediaLibraryId>","type":"sanity.asset"}`

### `sanitymcp_media_library_upload_from_url`

Media Library Upload From Url · Write

Start an image, video, or file upload from a public HTTPS URL to a Media Library. Optionally add a version to an existing asset. Returns an operationId immediately; use assets_upload_status to retrieve the asset, assetInstance, and uploadSession. Submit uploads individually and check their operation IDs together with assets_upload_status. Honor HTTP Retry-After when rate limited. If a request is interrupted before an operationId is returned, check the destination before repeating the upload. Source size and fetch time limits apply; processing may take several minutes. If a duplicate conflict returns error.existingAssetId, follow the error message to inspect the existing asset before retrying. For a local or private file, use `media_library_upload_from_file`.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `mediaLibraryId` (`string`, required): Target Media Library ID.
- `url` (`string`, required): Public HTTPS asset URL. Sanity fetches it without additional authentication headers.
- `aspects` (`string`, optional): Aspect values for a new asset, up to 64 KiB of JSON. Cannot be combined with assetId.
- `assetId` (`string`, optional): Existing Media Library asset ID to add a new version to. Cannot be combined with aspects.
- `assetType` (`string`, optional): Optional type override. Omit to detect the type from the source content. One of: `image`, `video`, `file`.
- `autoGenerateTitle` (`boolean`, optional): Generate a title from image content during processing. Omit to use the filename. Cannot be combined with title, even when false.
- `cdnAccessPolicy` (`string`, optional): No description. One of: `public`, `private`.
- `filename` (`string`, optional): Original filename, including extension. Not inferred from the source URL.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `requestKey` (`string`, optional): Optional UUID for retrying an interrupted request. Omit to generate one automatically. Reuse a supplied UUID with identical arguments to retrieve the same upload. For changed arguments or a new attempt after failure, omit it or provide a new UUID.
- `sessionId` (`string`, optional): No description.
- `sha1` (`string`, optional): Expected SHA-1 hash for validation.
- `title` (`string`, optional): Asset title. Omit to use the filename. Cannot be combined with autoGenerateTitle.

Example input: `{"mediaLibraryId":"<mediaLibraryId>","url":"https://www.sanity.io/docs/studio/installation"}`

### `sanitymcp_patch_documents`

Patch Document(s) · Write

Update or edit one or more existing documents by applying precise modifications using @sanity/client patch() operations. Patches for each document are applied as a single transaction (all succeed or all fail). Edits are saved to the draft or release version; published content is never modified directly.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `documents` (`object`, required): Map of document IDs to patch operations, up to 25 documents. Accepts published, draft (`drafts.<id>`), and version (`versions.<releaseId>.<id>`) IDs. Published and draft IDs edit the draft unless the document type has liveEdit enabled. Version IDs edit that release version. The entire request must fit within 100kb. Send fewer documents per call when writing large amounts of content.
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `releaseId` (`string`, optional): Optional release ID for patching documents in an existing release.
- `workspaceName` (`string`, optional): Deprecation notice: workspaceName for schema selection is deprecated, Sanity is moving to one authoritative schema per dataset. Consolidate competing schemas and resolve conflicts explicitly before migrating. During the deprecation period, workspaceName is still supported. Omit workspaceName for the sole active or default schema, or provide it when selecting another workspace. Exact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".

Example input: `{"dataset":"<dataset>","documents":{},"projectId":"<projectId>"}`

### `sanitymcp_publish_documents`

Publish Documents · Write

Publish one or more draft documents to make them publicly visible.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `ids` (`array`, required): Documents to publish, one entry per document: each publishes that document's current draft.
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `workspaceName` (`string`, optional): Deprecation notice: workspaceName for schema selection is deprecated, Sanity is moving to one authoritative schema per dataset. Consolidate competing schemas and resolve conflicts explicitly before migrating. During the deprecation period, workspaceName is still supported. Omit workspaceName for the sole active or default schema, or provide it when selecting another workspace. Exact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".

Example input: `{"dataset":"<dataset>","ids":[],"projectId":"<projectId>"}`

### `sanitymcp_schema_fields_patch`

Schema Fields Patch · Write

Add, replace, or remove top-level fields on one document or object type. Read the type with schema_type_get first and pass its current schemaVersion. Each fieldDeclaration is one JavaScript object literal using deploy_schema syntax. Requires an MCP-managed or Studio-deployed schema descriptor; use deploy_schema to create an MCP-managed schema first. Legacy-only schemas must be migrated before using these tools. Upstream read failures stop the edit and must be retried after recovery. Use a dry run to inspect conversion losses before writing. If local Studio files exist, edit those files unless the user explicitly requests remote takeover. Studio takeovers require explicit user confirmation. Blueprint-managed bindings must be updated from their Blueprint source because they do not identify the legacy workspace that MCP must also mirror.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `expectedSchemaVersion` (`string`, required): Current schemaVersion returned by schema_type_get. Required to reject stale edits.
- `operations` (`array`, required): Upsert or delete top-level fields in the named type.
- `projectId` (`string`, required): The Sanity project ID
- `typeName` (`string`, required): No description.
- `allowLossy` (`boolean`, optional): Allow rebuilding the schema when a dry run reports existing behavior that cannot be preserved. Set only after the user accepts the exact conversionLosses paths for this version.
- `confirmDeployTakeover` (`boolean`, optional): Confirm an explicitly authorized takeover of a Studio deployment.
- `dryRun` (`boolean`, optional): No description.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","expectedSchemaVersion":"<expectedSchemaVersion>","operations":[],"projectId":"<projectId>","typeName":"<typeName>"}`

### `sanitymcp_schema_type_get`

Schema Type Get · Write

Read one type from the current MCP-managed or Studio-deployed schema before calling a granular schema edit tool. Returns the current schemaVersion required for concurrency control and a reconstructed editable definition. Legacy-only and Blueprint-managed schemas cannot be edited with these tools.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `typeName` (`string`, required): Name of the schema type to edit.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","projectId":"<projectId>","typeName":"<typeName>"}`

### `sanitymcp_transform_image`

Transform Image · Write

Apply an AI transformation to an image field in a Sanity document.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `documentId` (`string`, required): The ID of the document containing the image
- `imagePath` (`string`, required): Path to the image field in the document (e.g., "image", "hero.image"). For image arrays, target with _key filtering: "images[_key==\"img1\"]".
- `instruction` (`string`, required): Natural language instructions for transforming the image. Acts like a prompt telling the internal Sanity AI what to do. Describe the desired changes (e.g., "Make the background more vibrant and add warm sunset lighting"). Keep instructions clear and specific for best results.
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `workspaceName` (`string`, optional): Deprecation notice: workspaceName for schema selection is deprecated, Sanity is moving to one authoritative schema per dataset. Consolidate competing schemas and resolve conflicts explicitly before migrating. During the deprecation period, workspaceName is still supported. Omit workspaceName for the sole active or default schema, or provide it when selecting another workspace. Exact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".

Example input: `{"dataset":"<dataset>","documentId":"movie-123","imagePath":"image","instruction":"Make the background more vibrant and add warm sunset lighting","projectId":"<projectId>"}`

### `sanitymcp_undeploy_schema`

Undeploy Schema · Write

Remove a legacy MCP-managed schema from an explicitly named workspace. Inspect list_workspace_schemas first and provide an explicit workspaceName. Removes the legacy schema document and MCP ownership record. Datasets with an active Schema API binding cannot be undeployed with this tool yet. Documents and hosted Studios are preserved; a hosted Studio can still contain its own schema snapshot. If a Studio deployed outside MCP shares the workspace name, removes only the MCP ownership record and leaves that Studio schema untouched. Refuses schemas managed outside MCP and provides instructions for their source. Use schema_types_delete to remove individual types instead.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `workspaceName` (`string`, required): Exact workspace name to undeploy. Use list_workspace_schemas to inspect deployed schemas first.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","projectId":"<projectId>","workspaceName":"<workspaceName>"}`

### `sanitymcp_update_dataset`

Update Dataset · Write

Update the access control mode or description of an existing Sanity dataset.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `projectId` (`string`, required): The Sanity project ID
- `aclMode` (`string`, optional): The ACL mode for the dataset. One of: `private`, `public`.
- `description` (`string`, optional): A brief description of the dataset purpose. Pass null to clear.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","projectId":"<projectId>"}`

### `sanitymcp_usage_history_get`

Usage History Get · Write

Get metered usage for a project, organization or media library as a series of daily, monthly or yearly data points. For the current period total, use usage_snapshot_get.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `resourceId` (`string`, required): ID of the project, organization or media library. Get project and organization IDs from list_projects or list_organizations.
- `resourceType` (`string`, required): Type of resource to read usage for. One of: `project`, `organization`, `media-library`.
- `cumulative` (`boolean`, optional): Also return a running total for counter metrics. Not supported with scope.
- `cumulativePeriod` (`string`, optional): When the running total resets to 0, locked to the calendar. Defaults to forever. Only used with cumulative. One of: `day`, `month`, `year`, `forever`.
- `from` (`string`, optional): First date of the range, such as 2026-01-01. Defaults to 30 days ago. Not aligned to the period, so use the first day of a month or year for whole periods.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `metrics` (`array`, optional): Metric names to return, such as ["apirequests", "apicdnrequests", "documents", "assets"]. Omit to return every metric. Call once without this to discover the available names.
- `period` (`string`, optional): Size of each data point. Defaults to month. day allows at most 90 days between from and to, month at most 24 months, year is unlimited. One of: `day`, `month`, `year`.
- `scope` (`string`, optional): Break usage down by this scope instead of returning resource totals. Currently the API supports "user" (per-user usage).
- `to` (`string`, optional): Last date of the range, such as 2026-09-30. Defaults to today. Not aligned to the period, so use the last day of a month or year for whole periods.

Example input: `{"resourceId":"<resourceId>","resourceType":"project"}`

### `sanitymcp_usage_snapshot_get`

Usage Snapshot Get · Write

Get metered usage totals, such as API requests, CDN requests, documents and assets, for a project, organization or media library over one billing period. For trends over time, use usage_history_get.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `resourceId` (`string`, required): ID of the project, organization or media library. Get project and organization IDs from list_projects or list_organizations.
- `resourceType` (`string`, required): Type of resource to read usage for. One of: `project`, `organization`, `media-library`.
- `date` (`string`, optional): Date to read the snapshot for, such as 2026-09-14. Defaults to today.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `metrics` (`array`, optional): Metric names to return, such as ["apirequests", "apicdnrequests", "documents", "assets"]. Omit to return every metric. Call once without this to discover the available names.
- `period` (`string`, optional): Billing period the snapshot covers. Defaults to month. With date 2026-09-14, month covers 2026-09-01 to 2026-09-14 and year covers 2026-01-01 to 2026-09-14. One of: `day`, `month`, `year`.
- `scope` (`string`, optional): Break usage down by this scope instead of returning resource totals. Currently the API supports "user" (per-user usage).
- `snapshotPeriod` (`string`, optional): startOfPeriod (default) counts from the start of the calendar period. previousPeriod counts a rolling window instead: with date 2026-09-14 and period month, it covers 2026-08-15 to 2026-09-14. One of: `startOfPeriod`, `previousPeriod`.

Example input: `{"resourceId":"<resourceId>","resourceType":"project"}`

### `sanitymcp_cors_origins_delete`

Delete CORS Origin · Destructive

Deletes a CORS origin from a Sanity project.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `origin` (`string`, required): CORS origin to delete, in format protocol://hostname[:port]. Must be an exact match.
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"origin":"<origin>","projectId":"<projectId>"}`

### `sanitymcp_discard_drafts`

Discard Drafts · Destructive

Discard draft versions of one or more documents.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `ids` (`array`, required): Document IDs to discard drafts for
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","ids":[],"projectId":"<projectId>"}`

### `sanitymcp_run_sanity_cli`

Run Sanity CLI · Destructive

Run a limited subset of Sanity CLI commands and return their output. Use `--help` to list available commands or `<command> --help` for command details. Commands run without a shell and cannot access the filesystem, prompt for input, run in the background, or change authentication. Dedicated Sanity MCP tools may provide more structured responses, but equivalent CLI commands are also available.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `args` (`string`, required): Arguments passed to the Sanity CLI after `sanity`, as a single string. Examples: `--help`, `datasets list`.
- `intent` (`string`, optional): Brief description of what you are trying to accomplish.

Example input: `{"args":"<args>"}`

### `sanitymcp_schema_types_delete`

Schema Types Delete · Destructive

Remove one or more types from the dataset schema. Read the type with schema_type_get first and pass its current schemaVersion. Types referenced by surviving types cannot be removed. Requires an MCP-managed or Studio-deployed schema descriptor; use deploy_schema to create an MCP-managed schema first. Legacy-only schemas must be migrated before using these tools. Upstream read failures stop the edit and must be retried after recovery. Use a dry run to inspect conversion losses before writing. If local Studio files exist, edit those files unless the user explicitly requests remote takeover. Studio takeovers require explicit user confirmation. Blueprint-managed bindings must be updated from their Blueprint source because they do not identify the legacy workspace that MCP must also mirror.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `expectedSchemaVersion` (`string`, required): Current schemaVersion returned by schema_type_get. Required to reject stale edits.
- `projectId` (`string`, required): The Sanity project ID
- `typeNames` (`array`, required): Names of types to remove together.
- `allowLossy` (`boolean`, optional): Allow rebuilding the schema when a dry run reports existing behavior that cannot be preserved. Set only after the user accepts the exact conversionLosses paths for this version.
- `confirmDeployTakeover` (`boolean`, optional): Confirm an explicitly authorized takeover of a Studio deployment.
- `dryRun` (`boolean`, optional): No description.
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","expectedSchemaVersion":"<expectedSchemaVersion>","projectId":"<projectId>","typeNames":[]}`

### `sanitymcp_unpublish_documents`

Unpublish Documents · Destructive

Unpublish one or more documents to revert them to draft state.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `ids` (`array`, required): IDs of the documents to unpublish. Without releaseId, provide published IDs only.
- `projectId` (`string`, required): The Sanity project ID
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.
- `releaseId` (`string`, optional): Optional release ID for scheduling documents to be unpublished when the release runs

Example input: `{"dataset":"<dataset>","ids":[],"projectId":"<projectId>"}`

### `sanitymcp_version_discard`

Version Discard · Destructive

Discard document versions associated with a release.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `dataset` (`string`, required): The name of the dataset in the project
- `ids` (`array`, required): Document IDs to discard from the release
- `projectId` (`string`, required): The Sanity project ID
- `releaseId` (`string`, required): ID of the release to discard the document versions from
- `intent` (`string`, optional): Briefly explain why you are making this tool call — the high-level goal, not the specific operation. For example: "migrating content from legacy CMS", "building a product catalog for launch", "cleaning up orphaned references after schema change". Make sure to not include any secrets, API keys, or information that can be considered sensitive. This helps us understand usage patterns and improve the tools.

Example input: `{"dataset":"<dataset>","ids":[],"projectId":"<projectId>","releaseId":"<releaseId>"}`

## Related

Other Developer Tools connectors ([all 131](/agentkit/connectors/?category=developer-tools)):

- [GitHub](/agentkit/connectors/github/): Scalekit connector, OAuth, 217 tools
- [Microsoft Entra ID](/agentkit/connectors/microsoftentraid/): Scalekit connector, OAuth, 82 tools
- [Datadog](/agentkit/connectors/datadog/): Scalekit connector, API key, 105 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
