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.
- Tools
- 61
- What they doRead · write · destructive
- 18 · 37 · 618 read37 write6 destructive
- Users sign in with
- OAuth
- OAuth app
- Scalekit's or your own
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
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Sanity MCP connection
In AgentKit > Connections, create a Sanity MCP connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Scalekit credentials are available for Sanity MCP server, so you don't need to register an OAuth app.
Authorize a user and make your first call
quickstart.mts 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.actionsconst connector = 'sanitymcp'const identifier = 'user_123'// Generate an authorization link for the userconst { 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 callconst result = await actions.executeTool({connector,identifier,toolName: 'sanitymcp_whoami',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_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.actionsconnection_name = "sanitymcp"identifier = "user_123"# Generate an authorization link for the userlink_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 callresult = actions.execute_tool(tool_input={},tool_name="sanitymcp_whoami",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user signs in once. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolsanitymcp__get_ui_contextGet the current UI context including the active document and workspace in Sanity Studio.Read-onlyGet Ui Context
Get the current UI context including the active document and workspace in Sanity Studio.
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
documentIdstring- The document ID to fetch context for. When omitted, returns project-level context only (studio URL).
documentTypestring- The document _type. When provided, the tool skips fetching the document to infer its type.
maxRefDepthinteger- Maximum depth for collecting reference IDs from the document (default 2)
workspaceNamestring- 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".
sanitymcp_cors_origins_listLists all CORS origins configured for a Sanity project.Read-onlyList CORS Origins
Lists all CORS origins configured for a Sanity project.
Inputs
projectIdstringrequired- The Sanity project ID
intentstring- 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.
sanitymcp_get_documentRetrieve a single Sanity document by its ID.Read-onlyGet Document
Retrieve a single Sanity document by its ID.
Inputs
datasetstringrequired- The name of the dataset in the project
documentIdstringrequired- 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.
projectIdstringrequired- The Sanity project ID
intentstring- 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.
sanitymcp_get_project_studiosList all Sanity Studios deployed for a project.Read-onlyGet Project Studios
List all Sanity Studios deployed for a project.
Inputs
projectIdstringrequired- The Sanity project ID
intentstring- 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.
sanitymcp_get_sanity_rulesLoad one or more Sanity content rules by name.Read-onlyGet Sanity Rules
Load one or more Sanity content rules by name.
Inputs
rulesarrayrequired- One or more rule names to load. Use list_sanity_rules to see available rules.
intentstring- Brief description of what you are trying to accomplish.
sanitymcp_get_schemaRetrieve the schema for a specific document type in a workspace.Read-onlyGet Schema
Retrieve the schema for a specific document type in a workspace.
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
intentstring- 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.
schemaIdstring- Optional exact schema ID returned by list_workspace_schemas. Use this to inspect a specific source when multiple deployments share a workspace name.
typestring- 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.
workspaceNamestring- 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 workspace name. Omit to use the sole deployed schema source, or default when there are multiple or none. If there are several sources without default, use list_workspace_schemas and pass an exact schemaId.
sanitymcp_list_datasetsList all datasets in a Sanity project.Read-onlyList Datasets
List all datasets in a Sanity project.
Inputs
projectIdstringrequired- The Sanity project ID
intentstring- 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.
sanitymcp_list_embeddings_indicesList all embeddings indices available in a Sanity project.Read-onlyList Embeddings Indices
List all embeddings indices available in a Sanity project.
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
intentstring- 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.
sanitymcp_list_organizationsList all Sanity organizations the authenticated user belongs to.Read-onlyList Organizations
List all Sanity organizations the authenticated user belongs to.
Inputs
intentstring- Brief description of what you are trying to accomplish.
sanitymcp_list_projectsList all Sanity projects the authenticated user has access to.Read-onlyList Projects
List all Sanity projects the authenticated user has access to.
Inputs
intentstring- Brief description of what you are trying to accomplish.
sanitymcp_list_releasesList content releases for a project with optional state filtering and pagination.Read-onlyList Releases
List content releases for a project with optional state filtering and pagination.
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
intentstring- 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.
limitinteger- Maximum number of releases to returndefault
10 offsetinteger- Number of releases to skip for paginationdefault
0 statestring- Filter releases by state. If omitted, returns active and scheduled releases (excludes published and archived).one of
activescheduledpublishedarchived
sanitymcp_list_sanity_rulesList all available Sanity content rule names.Read-onlyList Sanity Rules
List all available Sanity content rule names.
Inputs
intentstring- Brief description of what you are trying to accomplish.
sanitymcp_list_workspace_schemasList all schema types defined in a Sanity workspace.Read-onlyList Workspace Schemas
List all schema types defined in a Sanity workspace.
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
intentstring- 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.
sanitymcp_query_documentsExecute a GROQ query against the Sanity dataset and return matching documents.Read-onlyQuery Documents
Execute a GROQ query against the Sanity dataset and return matching documents.
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
querystringrequired- 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.
intentstring- 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.
paramsobject- Optional parameters for the GROQ query as a JSON object
perspectivestring- 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
sanitymcp_read_docsRead a Sanity documentation page by URL or path.Read-onlyRead Docs
Read a Sanity documentation page by URL or path.
Inputs
intentstring- 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.
pathstring- Path to the documentation page (e.g., "/docs/studio/installation" or "/changelog/studio-Ni41LjA")
urlstring- Full URL to the documentation page (e.g., "https://www.sanity.io/docs/studio/installation")
sanitymcp_search_docsSearch Sanity documentation by keyword query.Read-onlySearch Docs
Search Sanity documentation by keyword query.
Inputs
querystringrequired- GROQ query string to execute.
intentstring- Brief description of what you are trying to accomplish.
limitinteger- Maximum number of items to return.default
10
sanitymcp_semantic_searchPerform a semantic similarity search against a Sanity embeddings index.Read-onlySemantic Search
Perform a semantic similarity search against a Sanity embeddings index.
Inputs
datasetstringrequired- The name of the dataset in the project
indexNamestringrequired- The name of the embeddings index to search
projectIdstringrequired- The Sanity project ID
querystringrequired- The search query to find semantically similar content
intentstring- 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.
limitinteger- Maximum number of results to returndefault
10
sanitymcp_whoamiGet the currently authenticated Sanity user profile.Read-onlyWhoami
Get the currently authenticated Sanity user profile.
Inputs
intentstring- Brief description of what you are trying to accomplish.
sanitymcp_add_cors_originAdd a CORS origin to allow browser-based API access for a Sanity project.WriteAdd Cors Origin
Add a CORS origin to allow browser-based API access for a Sanity project.
Inputs
originstringrequired- 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
projectIdstringrequired- The Sanity project ID
allowCredentialsboolean- 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 intentstring- 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.
sanitymcp_assets_upload_statusCheck one to 20 asset uploads using operationIds.WriteAssets Upload Status
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.
Inputs
operationIdsarrayrequired- One to 20 operation IDs to check together. Poll only unfinished operations.
includeMetadataboolean- Include full asset metadata. By default, return asset IDs, URLs, and document references.
intentstring- 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.
sanitymcp_create_datasetCreate a new dataset in a Sanity project with the specified access control mode.WriteCreate Dataset
Create a new dataset in a Sanity project with the specified access control mode.
Inputs
datasetNamestringrequired- The name of the dataset
projectIdstringrequired- The Sanity project ID
aclModestring- The ACL mode for the datasetone of
privatepublic descriptionstring- A brief description of the dataset purpose
intentstring- 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.
sanitymcp_create_documentsCreate one or more draft documents by directly providing structured content.WriteCreate Document(s)
Create one or more draft documents by directly providing structured content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation.
Inputs
datasetstringrequired- The name of the dataset in the project
documentsarrayrequired- 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.
projectIdstringrequired- The Sanity project ID
intentstring- 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.
releaseIdstring- 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.
workspaceNamestring- 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. 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".
sanitymcp_create_projectCreate a new Sanity project with optional CORS origin and organization.WriteCreate Project
Create a new Sanity project with optional CORS origin and organization.
Inputs
displayNamestringrequired- Display name for the Sanity project.
organizationIdstringrequired- Sanity organization ID to create the project under.
allowCredentialsboolean- Whether to allow credentials (cookies) from this CORS origin.default
true corsOriginstring- CORS origin URL for the new project.
intentstring- Brief description of what you are trying to accomplish.
sanitymcp_create_releaseCreate a new content release for scheduling or grouping document publications.WriteCreate Release
Create a new content release for scheduling or grouping document publications.
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
titlestringrequired- Human-readable title for the release (e.g. "Q1 2024 Product Updates")
descriptionstring- Optional description of the release
intendedPublishAtstring- 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.
intentstring- 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.
releaseIdstring- Optional release ID, if omitted one is generated.
releaseTypestring- 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
asapundecidedscheduleddefaultundecided
sanitymcp_create_versionCreate versioned copies of documents and associate them with a release.WriteCreate Version
Create versioned copies of documents and associate them with a release.
Inputs
datasetstringrequired- The name of the dataset in the project
documentIdsarrayrequired- Array of document IDs to create versions for (min 1, max 10)
projectIdstringrequired- The Sanity project ID
releaseIdstringrequired- ID of the release to associate this version with
intentstring- 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.
sanitymcp_dataset_assets_upload_from_filePrepare a one-use URL for uploading an image or file up to 50 MiB to a Content Lake dataset.WriteDataset Assets Upload From File
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`.
Inputs
assetTypestringrequired- Upload as a dataset image or file asset.one of
imagefile datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
creditLinestring- No description.
descriptionstring- No description.
filenamestring- Original filename, including extension. Not inferred from the source URL.
includeMetadataboolean- 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.
intentstring- 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.
titlestring- No description.
sanitymcp_dataset_assets_upload_from_urlStart an image or file upload from a public HTTPS URL to a Content Lake dataset.WriteDataset Assets Upload From Url
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`.
Inputs
assetTypestringrequired- Upload as a dataset image or file asset.one of
imagefile datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
urlstringrequired- Public HTTPS asset URL. Sanity fetches it without additional authentication headers.
creditLinestring- No description.
descriptionstring- No description.
filenamestring- Original filename, including extension. Not inferred from the source URL.
intentstring- 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.
labelstring- No description.
metaarray- Metadata to extract. Omit to use the API defaults.
requestKeystring- 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.
sourceobject- External source attribution. Provide its name and asset ID together.
titlestring- No description.
sanitymcp_dataset_assets_upload_from_web_chatgptUpload a ChatGPT web attachment or generated file to a Content Lake dataset.WriteDataset Assets Upload From Web Chatgpt
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.
Inputs
assetTypestringrequired- Upload as a dataset image or file asset.one of
imagefile datasetstringrequired- The name of the dataset in the project
fileobjectrequired- ChatGPT web attachment or generated file. Pass the file using ChatGPT web file input.
projectIdstringrequired- The Sanity project ID
creditLinestring- No description.
descriptionstring- No description.
filenamestring- Original filename, including extension. Not inferred from the source URL.
intentstring- 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.
labelstring- No description.
metaarray- Metadata to extract. Omit to use the API defaults.
requestKeystring- 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.
sourceobject- External source attribution. Provide its name and asset ID together.
titlestring- No description.
sanitymcp_deploy_schemaDeploy a schema declaration to a Sanity project workspace.WriteDeploy Schema
Deploy a schema declaration to a Sanity project workspace.
- Idempotent
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
schemaDeclarationstringrequired- 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>
intentstring- 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.
workspaceNamestring- 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".
sanitymcp_deploy_studioDeploy a Sanity Studio to a hosted app subdomain.WriteDeploy Studio
Deploy a Sanity Studio to a hosted app subdomain.
- Idempotent
Inputs
appHoststringrequired- Studio subdomain — globally unique across sanity.studio. The concrete URL is returned as `studioUrl` on success.
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
titlestringrequired- Human-facing title shown in Studio navigation.
intentstring- 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.
workspaceNamestring- 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".
sanitymcp_documents_validateValidate documents against the deployed schema without modifying them.WriteDocuments Validate
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.
Inputs
datasetstringrequired- The name of the dataset in the project
documentIdsarrayrequired- Exact IDs of the documents to validate, e.g. "drafts.article-1"
projectIdstringrequired- The Sanity project ID
intentstring- 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.
workspaceNamestring- 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".
sanitymcp_generate_imageGenerate an image for a document field using an AI instruction.WriteGenerate Image
Generate an image for a document field using an AI instruction.
Inputs
datasetstringrequired- The name of the dataset in the project
documentIdstringrequired- The ID of the document containing the image
imagePathstringrequired- 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.
instructionstringrequired- 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.
projectIdstringrequired- The Sanity project ID
intentstring- 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.
workspaceNamestring- 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. 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".
sanitymcp_give_sanity_feedbackSubmit feedback about Sanity when you encounter issues while working with a Sanity codebase or project.WriteGive Sanity Feedback
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.
Inputs
messagestringrequired- 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.
categorystring- Category of feedback to help with triageone of
tool_errormissing_capabilityconfusing_outputdocumentationsanity_apiother intentstring- 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.
mediaLibraryIdstring- The Media Library ID this feedback relates to, if any — the `mediaLibraryId` you passed to a `media_library_*` tool.
organizationIdstring- The organization ID this feedback relates to, if known. Media Libraries belong to an organization rather than a project.
projectIdstring- The Sanity project ID this feedback relates to, if any. Leave unset for general feedback not tied to a specific project.
severitystring- How much this blocked progress. high = completely blocked, medium = workaround needed, low = minorone of
lowmediumhighdefaultmedium toolNamestring- The MCP tool this feedback is about, if any (e.g. "query_documents"). Leave unset for general Sanity feedback.
sanitymcp_media_assets_upload_from_urlDeprecated.WriteMedia Assets Upload From Url
Deprecated. Use media_library_upload_from_url with the same arguments. This tool does not start an upload.
Inputs
mediaLibraryIdstringrequired- Target Media Library ID.
urlstringrequired- Public HTTPS asset URL. Sanity fetches it without additional authentication headers.
aspectsstring- Aspect values for a new asset, up to 64 KiB of JSON. Cannot be combined with assetId.
assetIdstring- Existing Media Library asset ID to add a new version to. Cannot be combined with aspects.
assetTypestring- Optional type override. Omit to detect the type from the source content.one of
imagevideofile autoGenerateTitleboolean- Generate a title from image content during processing. Omit to use the filename. Cannot be combined with title, even when false.
cdnAccessPolicystring- No description.one of
publicprivate filenamestring- Original filename, including extension. Not inferred from the source URL.
intentstring- 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.
requestKeystring- 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.
sessionIdstring- No description.
sha1string- Expected SHA-1 hash for validation.
titlestring- Asset title. Omit to use the filename. Cannot be combined with autoGenerateTitle.
sanitymcp_media_library_create_documentsCreate documents in a Media Library.WriteMedia Library Create Documents
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.
Inputs
documentsarrayrequired- Array of documents to create (max 25). Each document must have a type and content, with every document field inside content.
mediaLibraryIdstringrequired- 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`.
intentstring- 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.
sanitymcp_media_library_discard_draftsDiscard asset drafts, throwing away unpublished metadata edits and leaving the published asset intact.WriteMedia Library Discard Drafts
Discard asset drafts, throwing away unpublished metadata edits and leaving the published asset intact.
Inputs
idsarrayrequired- Asset IDs to discard unpublished metadata edits for (max 25).
mediaLibraryIdstringrequired- 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`.
intentstring- 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.
sanitymcp_media_library_get_documentFetch a single Media Library document by its exact ID.WriteMedia Library Get Document
Fetch a single Media Library document by its exact ID. This is a direct ID lookup only - it does not search, filter, or query.
Inputs
documentIdstringrequired- The exact document ID to fetch, e.g. an asset ID, or a `drafts.` prefixed ID for an asset with unpublished metadata edits.
mediaLibraryIdstringrequired- 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`.
intentstring- 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.
sanitymcp_media_library_get_schemaGet the document types of a Media Library, or the full field definitions for one type.WriteMedia Library Get Schema
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`.
Inputs
mediaLibraryIdstringrequired- 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`.
intentstring- 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.
typestring- Optional document type to get the full schema definition for, e.g. "sanity.asset". Omit for an overview of the available types.
sanitymcp_media_library_link_assetsMake one or more Media Library assets usable in project documents.WriteMedia Library Link Assets
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`.
Inputs
datasetstringrequired- The target dataset to link the assets into.
linksarrayrequired- The assets to link (max 25). Each is processed independently.
mediaLibraryIdstringrequired- 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`.
projectIdstringrequired- The target project ID to link the assets into.
intentstring- 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.
sanitymcp_media_library_listLists the Sanity Media Libraries in an organization.WriteMedia Library List
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.
Inputs
organizationIdstringrequired- The organization ID to list Media Libraries for (as returned by `list_organizations`).
intentstring- 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.
sanitymcp_media_library_list_asset_referencesLists documents (across project datasets) that reference a Media Library asset.WriteMedia Library List Asset References
Lists documents (across project datasets) that reference a Media Library asset. Use this before replacing an asset to see what depends on it.
Inputs
assetIdstringrequired- The published asset container ID (`sanity.asset` `_id`, without a `drafts.` prefix) to find references for. References always point at the published asset.
mediaLibraryIdstringrequired- 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`.
cursorstring- Pagination cursor (`nextCursor`) from a previous response.
intentstring- 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.
sanitymcp_media_library_patch_documentsEdit Media Library documents.WriteMedia Library Patch Documents
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.
Inputs
documentsobjectrequired- 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.
mediaLibraryIdstringrequired- 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`.
intentstring- 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.
sanitymcp_media_library_publish_documentsPublish asset drafts to make unpublished metadata edits (`title`, `aspects.*`) live, preserving published-only and system-managed fields.WriteMedia Library Publish Documents
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.
Inputs
idsarrayrequired- Asset IDs to publish metadata edits for (max 25). Draft or published IDs both work.
mediaLibraryIdstringrequired- 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`.
intentstring- 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.
sanitymcp_media_library_query_documentsQuery a Media Library using GROQ.WriteMedia Library Query Documents
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.
Inputs
mediaLibraryIdstringrequired- 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`.
querystringrequired- Complete GROQ query (e.g. "*[_type == \"sanity.asset\"][0...10]{_id, title}")
intentstring- 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.
limitinteger- Maximum number of documents to returndefault
10 paramsobject- Optional parameters for the GROQ query
perspectivestring- 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
rawdraftspublisheddefaultraw
sanitymcp_media_library_upload_from_filePrepare 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.WriteMedia Library Upload From File
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.
Inputs
filenamestringrequired- Original filename, including extension.
mediaLibraryIdstringrequired- Target Media Library ID.
typestringrequired- Type of asset being uploaded.one of
imagevideofile aspectsstring- Aspect values for a new asset, up to 64 KiB of JSON. Cannot be combined with assetId.
assetIdstring- Existing Media Library asset ID to add a new version to. Cannot be combined with aspects.
autoGenerateTitleboolean- Generate a title from image content during processing. Omit to use the filename. Cannot be combined with title, even when false.
cdnAccessPolicystring- No description.one of
publicprivate intentstring- 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.
sessionIdstring- No description.
sha1string- Expected SHA-1 hash for validation.
titlestring- Asset title. Omit to use the filename. Cannot be combined with autoGenerateTitle.
sanitymcp_media_library_upload_from_urlStart an image, video, or file upload from a public HTTPS URL to a Media Library.WriteMedia Library Upload From Url
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`.
Inputs
mediaLibraryIdstringrequired- Target Media Library ID.
urlstringrequired- Public HTTPS asset URL. Sanity fetches it without additional authentication headers.
aspectsstring- Aspect values for a new asset, up to 64 KiB of JSON. Cannot be combined with assetId.
assetIdstring- Existing Media Library asset ID to add a new version to. Cannot be combined with aspects.
assetTypestring- Optional type override. Omit to detect the type from the source content.one of
imagevideofile autoGenerateTitleboolean- Generate a title from image content during processing. Omit to use the filename. Cannot be combined with title, even when false.
cdnAccessPolicystring- No description.one of
publicprivate filenamestring- Original filename, including extension. Not inferred from the source URL.
intentstring- 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.
requestKeystring- 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.
sessionIdstring- No description.
sha1string- Expected SHA-1 hash for validation.
titlestring- Asset title. Omit to use the filename. Cannot be combined with autoGenerateTitle.
sanitymcp_patch_documentsUpdate or edit one or more existing documents by applying precise modifications using @sanity/client patch() operations.WritePatch Document(s)
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.
Inputs
datasetstringrequired- The name of the dataset in the project
documentsobjectrequired- 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.
projectIdstringrequired- The Sanity project ID
intentstring- 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.
releaseIdstring- Optional release ID for patching documents in an existing release.
workspaceNamestring- 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. 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".
sanitymcp_publish_documentsPublish one or more draft documents to make them publicly visible.WritePublish Documents
Publish one or more draft documents to make them publicly visible.
- Idempotent
Inputs
datasetstringrequired- The name of the dataset in the project
idsarrayrequired- Documents to publish, one entry per document: each publishes that document's current draft.
projectIdstringrequired- The Sanity project ID
intentstring- 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.
workspaceNamestring- 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. 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".
sanitymcp_schema_fields_patchAdd, replace, or remove top-level fields on one document or object type.WriteSchema Fields Patch
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.
Inputs
datasetstringrequired- The name of the dataset in the project
expectedSchemaVersionstringrequired- Current schemaVersion returned by schema_type_get. Required to reject stale edits.
operationsarrayrequired- Upsert or delete top-level fields in the named type.
projectIdstringrequired- The Sanity project ID
typeNamestringrequired- No description.
allowLossyboolean- 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.
confirmDeployTakeoverboolean- Confirm an explicitly authorized takeover of a Studio deployment.
dryRunboolean- No description.
intentstring- 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.
sanitymcp_schema_type_getRead one type from the current MCP-managed or Studio-deployed schema before calling a granular schema edit tool.WriteSchema Type Get
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.
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
typeNamestringrequired- Name of the schema type to edit.
intentstring- 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.
sanitymcp_transform_imageApply an AI transformation to an image field in a Sanity document.WriteTransform Image
Apply an AI transformation to an image field in a Sanity document.
Inputs
datasetstringrequired- The name of the dataset in the project
documentIdstringrequired- The ID of the document containing the image
imagePathstringrequired- Path to the image field in the document (e.g., "image", "hero.image"). For image arrays, target with _key filtering: "images[_key==\"img1\"]".
instructionstringrequired- 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.
projectIdstringrequired- The Sanity project ID
intentstring- 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.
workspaceNamestring- 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. 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".
sanitymcp_undeploy_schemaRemove a legacy MCP-managed schema from an explicitly named workspace.WriteUndeploy Schema
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.
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
workspaceNamestringrequired- Exact workspace name to undeploy. Use list_workspace_schemas to inspect deployed schemas first.
intentstring- 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.
sanitymcp_update_datasetUpdate the access control mode or description of an existing Sanity dataset.WriteUpdate Dataset
Update the access control mode or description of an existing Sanity dataset.
- Idempotent
Inputs
datasetstringrequired- The name of the dataset in the project
projectIdstringrequired- The Sanity project ID
aclModestring- The ACL mode for the datasetone of
privatepublic descriptionstring- A brief description of the dataset purpose. Pass null to clear.
intentstring- 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.
sanitymcp_usage_history_getGet metered usage for a project, organization or media library as a series of daily, monthly or yearly data points.WriteUsage History Get
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.
Inputs
resourceIdstringrequired- ID of the project, organization or media library. Get project and organization IDs from list_projects or list_organizations.
resourceTypestringrequired- Type of resource to read usage forone of
projectorganizationmedia-library cumulativeboolean- Also return a running total for counter metrics. Not supported with scope.
cumulativePeriodstring- When the running total resets to 0, locked to the calendar. Defaults to forever. Only used with cumulative.one of
daymonthyearforever fromstring- 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.
intentstring- 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.
metricsarray- Metric names to return, such as ["apirequests", "apicdnrequests", "documents", "assets"]. Omit to return every metric. Call once without this to discover the available names.
periodstring- 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
daymonthyear scopestring- Break usage down by this scope instead of returning resource totals. Currently the API supports "user" (per-user usage).
tostring- 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.
sanitymcp_usage_snapshot_getGet metered usage totals, such as API requests, CDN requests, documents and assets, for a project, organization or media library over one billing period.WriteUsage Snapshot Get
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.
Inputs
resourceIdstringrequired- ID of the project, organization or media library. Get project and organization IDs from list_projects or list_organizations.
resourceTypestringrequired- Type of resource to read usage forone of
projectorganizationmedia-library datestring- Date to read the snapshot for, such as 2026-09-14. Defaults to today.
intentstring- 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.
metricsarray- Metric names to return, such as ["apirequests", "apicdnrequests", "documents", "assets"]. Omit to return every metric. Call once without this to discover the available names.
periodstring- 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
daymonthyear scopestring- Break usage down by this scope instead of returning resource totals. Currently the API supports "user" (per-user usage).
snapshotPeriodstring- 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
startOfPeriodpreviousPeriod
sanitymcp_cors_origins_deleteDeletes a CORS origin from a Sanity project.DestructiveDelete CORS Origin
Deletes a CORS origin from a Sanity project.
Inputs
originstringrequired- CORS origin to delete, in format protocol://hostname[:port]. Must be an exact match.
projectIdstringrequired- The Sanity project ID
intentstring- 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.
sanitymcp_discard_draftsDiscard draft versions of one or more documents.DestructiveDiscard Drafts
Discard draft versions of one or more documents.
- Idempotent
Inputs
datasetstringrequired- The name of the dataset in the project
idsarrayrequired- Document IDs to discard drafts for
projectIdstringrequired- The Sanity project ID
intentstring- 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.
sanitymcp_run_sanity_cliRun a limited subset of Sanity CLI commands and return their output.DestructiveRun Sanity CLI
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.
Inputs
argsstringrequired- Arguments passed to the Sanity CLI after `sanity`, as a single string. Examples: `--help`, `datasets list`.
intentstring- Brief description of what you are trying to accomplish.
sanitymcp_schema_types_deleteRemove one or more types from the dataset schema.DestructiveSchema Types Delete
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.
Inputs
datasetstringrequired- The name of the dataset in the project
expectedSchemaVersionstringrequired- Current schemaVersion returned by schema_type_get. Required to reject stale edits.
projectIdstringrequired- The Sanity project ID
typeNamesarrayrequired- Names of types to remove together.
allowLossyboolean- 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.
confirmDeployTakeoverboolean- Confirm an explicitly authorized takeover of a Studio deployment.
dryRunboolean- No description.
intentstring- 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.
sanitymcp_unpublish_documentsUnpublish one or more documents to revert them to draft state.DestructiveUnpublish Documents
Unpublish one or more documents to revert them to draft state.
- Idempotent
Inputs
datasetstringrequired- The name of the dataset in the project
idsarrayrequired- IDs of the documents to unpublish. Without releaseId, provide published IDs only.
projectIdstringrequired- The Sanity project ID
intentstring- 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.
releaseIdstring- Optional release ID for scheduling documents to be unpublished when the release runs
sanitymcp_version_discardDiscard document versions associated with a release.DestructiveVersion Discard
Discard document versions associated with a release.
- Idempotent
Inputs
datasetstringrequired- The name of the dataset in the project
idsarrayrequired- Document IDs to discard from the release
projectIdstringrequired- The Sanity project ID
releaseIdstringrequired- ID of the release to discard the document versions from
intentstring- 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.
No tools match.