Sanity MCP
sanity_mcpQuery, create, patch and publish Sanity content, manage schemas, releases, datasets, projects, CORS origins and Media Library assets through Sanity's hosted MCP server.
Acciones disponibles (61)
Cada acción es una operación que el agente puede ejecutar contra este conector. Haz clic en una acción para ver sus parámetros.
Add cors originSANITY_MCP_ADD_CORS_ORIGINAcciónAdds CORS origin(s) to allow client-side requests to a Sanity project
SANITY_MCP_ADD_CORS_ORIGINAcciónAdds CORS origin(s) to allow client-side requests to a Sanity project
Parámetros de entrada
intentstringBriefly 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.
originstringObligatorioCORS 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
projectIdstringObligatorioThe Sanity project ID
allowCredentialsbooleanAllow authenticated requests from this origin. Required for hosting a Studio or making authenticated API requests. Defaults to true. Always false when origin is `*`.
Parámetros de salida
Sin parámetros.
Assets upload statusSANITY_MCP_ASSETS_UPLOAD_STATUSAcciónCheck 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.
SANITY_MCP_ASSETS_UPLOAD_STATUSAcciónCheck 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.
Parámetros de entrada
intentstringBriefly 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.
operationIdsstring[]ObligatorioOne to 20 operation IDs to check together. Poll only unfinished operations.
includeMetadatabooleanInclude full asset metadata. By default, return asset IDs, URLs, and document references.
Parámetros de salida
erroranyresultobjectstatusstringenumrunningcompletedfailedunknownmessagestringexpiresAtstringoperationsarrayoperationIdstringpollAfterMsnumber
Cors origins deleteSANITY_MCP_CORS_ORIGINS_DELETEAcciónDeletes a CORS origin from a Sanity project
SANITY_MCP_CORS_ORIGINS_DELETEAcciónDeletes a CORS origin from a Sanity project
Parámetros de entrada
intentstringBriefly 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.
originstringObligatorioCORS origin to delete, in format protocol://hostname[:port]. Must be an exact match.
projectIdstringObligatorioThe Sanity project ID
Parámetros de salida
Sin parámetros.
Cors origins listSANITY_MCP_CORS_ORIGINS_LISTAcciónLists all CORS origins configured for a Sanity project
SANITY_MCP_CORS_ORIGINS_LISTAcciónLists all CORS origins configured for a Sanity project
Parámetros de entrada
intentstringBriefly 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.
projectIdstringObligatorioThe Sanity project ID
Parámetros de salida
Sin parámetros.
Create datasetSANITY_MCP_CREATE_DATASETAcciónCreates a new dataset with specified name and access settings
SANITY_MCP_CREATE_DATASETAcciónCreates a new dataset with specified name and access settings
Parámetros de entrada
intentstringBriefly 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.
aclModestringenumThe ACL mode for the dataset
privatepublicprojectIdstringObligatorioThe Sanity project ID
datasetNamestringObligatorioThe name of the dataset
descriptionstringA brief description of the dataset purpose
Parámetros de salida
Sin parámetros.
Create documentsSANITY_MCP_CREATE_DOCUMENTSAcciónCreate one or more documents by directly providing structured content. Creates drafts (drafts.* prefix), published documents for types with liveEdit enabled, or release versions when releaseId is specified.
SANITY_MCP_CREATE_DOCUMENTSAcciónCreate one or more documents by directly providing structured content. Creates drafts (drafts.* prefix), published documents for types with liveEdit enabled, or release versions when releaseId is specified.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
documentsobject[]ObligatorioArray 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.
projectIdstringObligatorioThe Sanity project ID
releaseIdstringOptional 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.
workspaceNamestringDeprecation 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".
Parámetros de salida
Sin parámetros.
Create projectSANITY_MCP_CREATE_PROJECTAcciónCreates a new Sanity project and initializes it with a dataset and API tokens
SANITY_MCP_CREATE_PROJECTAcciónCreates a new Sanity project and initializes it with a dataset and API tokens
Parámetros de entrada
intentstringBriefly 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.
corsOriginstringCORS origin to allow, in format protocol://hostname[:port], or a supported app builder alias. Use * for wildcard. `*` allows any origin and always disables credentials. Wildcards within a specific origin, such as `https://*.example.com`, can allow credentials. Supported app builder aliases: - lovable - figma-make - v0 - bolt If a supported app builder was provided instead of a specific origin, use that builder's alias. Other common values: - http://localhost:3000: For embedding Studio in Next.js, React, or similar frameworks during local development - https://*.vercel.app: For v0 published apps - https://*.bolt.host: For Bolt published apps Choose based on where your Studio or frontend will run. Additional CORS origins can be managed via the Sanity CLI using `sanity cors add`.
displayNamestringObligatorioThe display name for the new project
organizationIdstringObligatorioOrganization ID to create the project in
allowCredentialsbooleanAllow authenticated requests from this origin. Required for hosting a Studio. Defaults to true. Always false when corsOrigin is `*`.
Parámetros de salida
Sin parámetros.
Create releaseSANITY_MCP_CREATE_RELEASEAcciónCreate a new release for grouping content changes. Optionally provide releaseId; if omitted, one is generated. Does not schedule the release: releaseType and intendedPublishAt are recorded as metadata only. Scheduling, publishing, archiving and deleting a release are not available here and must be done in Sanity Studio or via the HTTP Actions API.
SANITY_MCP_CREATE_RELEASEAcciónCreate a new release for grouping content changes. Optionally provide releaseId; if omitted, one is generated. Does not schedule the release: releaseType and intendedPublishAt are recorded as metadata only. Scheduling, publishing, archiving and deleting a release are not available here and must be done in Sanity Studio or via the HTTP Actions API.
Parámetros de entrada
titlestringObligatorioHuman-readable title for the release (e.g. "Q1 2024 Product Updates")
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
releaseIdstringOptional release ID, if omitted one is generated.
descriptionstringOptional description of the release
releaseTypestringenumRelease 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.
asapundecidedscheduledintendedPublishAtstringdate-timeISO 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.
Parámetros de salida
Sin parámetros.
Create versionSANITY_MCP_CREATE_VERSIONAcciónCreate a version document (versions.{releaseId}.* prefix) for a specific release. Versions are separate from drafts and published documents, and are used for scheduled release workflows. When adding a document to a release with content changes, call create_version before patch_documents, then patch the returned version ID with the same releaseId. Do not patch the published or draft ID first because that creates an unrelated draft.
SANITY_MCP_CREATE_VERSIONAcciónCreate a version document (versions.{releaseId}.* prefix) for a specific release. Versions are separate from drafts and published documents, and are used for scheduled release workflows. When adding a document to a release with content changes, call create_version before patch_documents, then patch the returned version ID with the same releaseId. Do not patch the published or draft ID first because that creates an unrelated draft.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
releaseIdstringObligatorioID of the release to associate this version with
documentIdsstring[]ObligatorioArray of document IDs to create versions for (min 1, max 10)
Parámetros de salida
Sin parámetros.
Dataset assets upload from fileSANITY_MCP_DATASET_ASSETS_UPLOAD_FROM_FILEAcciónPrepare 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`.
SANITY_MCP_DATASET_ASSETS_UPLOAD_FROM_FILEAcciónPrepare 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`.
Parámetros de entrada
titlestringintentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
filenamestringOriginal filename, including extension. Not inferred from the source URL.
assetTypestringObligatorioenumUpload as a dataset image or file asset.
imagefileprojectIdstringObligatorioThe Sanity project ID
creditLinestringdescriptionstringincludeMetadatabooleanReturn 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.
Parámetros de salida
methodstringObligatoriomaxBytesnumberObligatoriouploadUrlstringObligatorioinstructionsstringObligatoriouploadExpiresAtstringObligatorio
Dataset assets upload from urlSANITY_MCP_DATASET_ASSETS_UPLOAD_FROM_URLAcciónStart 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`.
SANITY_MCP_DATASET_ASSETS_UPLOAD_FROM_URLAcciónStart 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`.
Parámetros de entrada
urlstringObligatoriouriPublic HTTPS asset URL. Sanity fetches it without additional authentication headers.
metastring[]Metadata to extract. Omit to use the API defaults.
labelstringtitlestringintentstringBriefly 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.
sourceobjectExternal source attribution. Provide its name and asset ID together.
datasetstringObligatorioThe name of the dataset in the project
filenamestringOriginal filename, including extension. Not inferred from the source URL.
assetTypestringObligatorioenumUpload as a dataset image or file asset.
imagefileprojectIdstringObligatorioThe Sanity project ID
creditLinestringrequestKeystringuuidOptional 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.
descriptionstring
Parámetros de salida
erroranyresultobjectstatusstringObligatorioenumrunningcompletedfailedunknownmessagestringexpiresAtstringObligatoriooperationIdstringObligatoriopollAfterMsnumber
Dataset assets upload from web chatgptSANITY_MCP_DATASET_ASSETS_UPLOAD_FROM_WEB_CHATGPTAcciónUpload 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.
SANITY_MCP_DATASET_ASSETS_UPLOAD_FROM_WEB_CHATGPTAcciónUpload 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.
Parámetros de entrada
fileobjectObligatorioChatGPT web attachment or generated file. Pass the file using ChatGPT web file input.
metastring[]Metadata to extract. Omit to use the API defaults.
labelstringtitlestringintentstringBriefly 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.
sourceobjectExternal source attribution. Provide its name and asset ID together.
datasetstringObligatorioThe name of the dataset in the project
filenamestringOriginal filename, including extension. Not inferred from the source URL.
assetTypestringObligatorioenumUpload as a dataset image or file asset.
imagefileprojectIdstringObligatorioThe Sanity project ID
creditLinestringrequestKeystringuuidOptional 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.
descriptionstring
Parámetros de salida
erroranyresultobjectstatusstringObligatorioenumrunningcompletedfailedunknownmessagestringexpiresAtstringObligatoriooperationIdstringObligatoriopollAfterMsnumber
Deploy schemaSANITY_MCP_DEPLOY_SCHEMAAcciónOnly use `deploy_schema` when no local Sanity Studio project exists. Coding agents must inspect the current working directory for `sanity.config.*` or `sanity.cli.*` and confirm none exist; an empty remote schema is not confirmation. MCP-only agents may use it when the task provides no local Studio context. When local Studio files exist, edit them and use the CLI only on explicit request — never use this tool as a fallback.
Deploys an MCP-managed schema for a workspace. Writes to MCP-managed workspaces and adopts legacy `system.schema` workspaces into MCP management on first call. Refuses Studio-deployed workspaces. Can add new types or overwrite existing types iteratively.
When called on a legacy workspace, the existing types become the baseline; pass an empty `schemaDeclaration` to adopt the legacy types as-is, or pass new types to add them on top.
`preview` configuration is not currently supported. Requests containing `preview` fail before deployment; use a local Studio project when custom document previews are required.
If a Studio-deployed schema already exists at the target workspaceName, this tool refuses. Either update the Studio source and deploy via CLI, or choose a different `workspaceName` for a new MCP-managed schema.
The separation goes both ways for writes: once a workspace is MCP-managed, schemas deployed to the same workspaceName via `npx sanity@latest schema deploy` are not selected by the default MCP resolver. Use `list_workspace_schemas` and exact `schemaId` reads to inspect both records before changing source.
SANITY_MCP_DEPLOY_SCHEMAAcciónOnly use `deploy_schema` when no local Sanity Studio project exists. Coding agents must inspect the current working directory for `sanity.config.*` or `sanity.cli.*` and confirm none exist; an empty remote schema is not confirmation. MCP-only agents may use it when the task provides no local Studio context. When local Studio files exist, edit them and use the CLI only on explicit request — never use this tool as a fallback. Deploys an MCP-managed schema for a workspace. Writes to MCP-managed workspaces and adopts legacy `system.schema` workspaces into MCP management on first call. Refuses Studio-deployed workspaces. Can add new types or overwrite existing types iteratively. When called on a legacy workspace, the existing types become the baseline; pass an empty `schemaDeclaration` to adopt the legacy types as-is, or pass new types to add them on top. `preview` configuration is not currently supported. Requests containing `preview` fail before deployment; use a local Studio project when custom document previews are required. If a Studio-deployed schema already exists at the target workspaceName, this tool refuses. Either update the Studio source and deploy via CLI, or choose a different `workspaceName` for a new MCP-managed schema. The separation goes both ways for writes: once a workspace is MCP-managed, schemas deployed to the same workspaceName via `npx sanity@latest schema deploy` are not selected by the default MCP resolver. Use `list_workspace_schemas` and exact `schemaId` reads to inspect both records before changing source.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
workspaceNamestringExact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".
schemaDeclarationstringObligatorioSanity 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>
Parámetros de salida
Sin parámetros.
Deploy studioSANITY_MCP_DEPLOY_STUDIOAcciónDeploy a managed Sanity Studio bound to an MCP-managed schema. Creates a hosted Studio whose URL follows the current environment — `sanity.studio` on production, `studio.sanity.work` on staging — and returns the concrete `studioUrl` in the response.
Requires an existing MCP-managed schema at the same `(projectId, dataset, workspaceName)` address — call `deploy_schema` first if none exists. Re-run after subsequent `deploy_schema` calls so the deployed Studio picks up the latest schema.
SANITY_MCP_DEPLOY_STUDIOAcciónDeploy a managed Sanity Studio bound to an MCP-managed schema. Creates a hosted Studio whose URL follows the current environment — `sanity.studio` on production, `studio.sanity.work` on staging — and returns the concrete `studioUrl` in the response. Requires an existing MCP-managed schema at the same `(projectId, dataset, workspaceName)` address — call `deploy_schema` first if none exists. Re-run after subsequent `deploy_schema` calls so the deployed Studio picks up the latest schema.
Parámetros de entrada
titlestringObligatorioHuman-facing title shown in Studio navigation.
intentstringBriefly 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.
appHoststringObligatorioStudio subdomain — globally unique across sanity.studio. The concrete URL is returned as `studioUrl` on success.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
workspaceNamestringExact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".
Parámetros de salida
Sin parámetros.
Discard draftsSANITY_MCP_DISCARD_DRAFTSAcciónDiscard one or more draft documents. If a document is published and has a draft, this removes the draft while leaving the published version intact. Use unpublish_documents before this tool if you want to remove a published document entirely.
SANITY_MCP_DISCARD_DRAFTSAcciónDiscard one or more draft documents. If a document is published and has a draft, this removes the draft while leaving the published version intact. Use unpublish_documents before this tool if you want to remove a published document entirely.
Parámetros de entrada
idsstring[]ObligatorioDocument IDs to discard drafts for
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
Parámetros de salida
Sin parámetros.
Documents validateSANITY_MCP_DOCUMENTS_VALIDATEAcciónValidate documents against the deployed schema without modifying them. This tool is in beta. Results may be incorrect or incomplete; review them before making changes.
SANITY_MCP_DOCUMENTS_VALIDATEAcciónValidate documents against the deployed schema without modifying them. This tool is in beta. Results may be incorrect or incomplete; review them before making changes.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
documentIdsstring[]ObligatorioExact IDs of the documents to validate, e.g. "drafts.article-1"
workspaceNamestringDeprecation 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".
Parámetros de salida
Sin parámetros.
Generate imageSANITY_MCP_GENERATE_IMAGEAcciónGenerate a new image in a document using AI. When targeting a published document, this creates or updates a draft with the generated image (published document remains unchanged). The draft must be published separately to make changes live. For image arrays, automatically adds a new array item. Note: Image generation is asynchronous and completes in the background.
SANITY_MCP_GENERATE_IMAGEAcciónGenerate a new image in a document using AI. When targeting a published document, this creates or updates a draft with the generated image (published document remains unchanged). The draft must be published separately to make changes live. For image arrays, automatically adds a new array item. Note: Image generation is asynchronous and completes in the background.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
imagePathstringObligatorioPath 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.
projectIdstringObligatorioThe Sanity project ID
documentIdstringObligatorioThe ID of the document containing the image
instructionstringObligatorioNatural 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.
workspaceNamestringDeprecation 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".
Parámetros de salida
Sin parámetros.
Get documentSANITY_MCP_GET_DOCUMENTAcciónFetch a single document by its exact ID. This is a direct ID lookup only - it does not search, filter, or query. Use when you have a specific document ID and need its full content.
SANITY_MCP_GET_DOCUMENTAcciónFetch a single document by its exact ID. This is a direct ID lookup only - it does not search, filter, or query. Use when you have a specific document ID and need its full content.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
documentIdstringObligatorioThe 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.
Parámetros de salida
Sin parámetros.
Get project studiosSANITY_MCP_GET_PROJECT_STUDIOSAcciónRetrieves all studio applications linked to a specific Sanity project
SANITY_MCP_GET_PROJECT_STUDIOSAcciónRetrieves all studio applications linked to a specific Sanity project
Parámetros de entrada
intentstringBriefly 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.
projectIdstringObligatorioThe Sanity project ID
Parámetros de salida
Sin parámetros.
Get sanity rulesSANITY_MCP_GET_SANITY_RULESAcciónLoad Sanity development rules. ALWAYS call list_sanity_rules first to see available rules, then load all rules relevant to your task in a single call.
SANITY_MCP_GET_SANITY_RULESAcciónLoad Sanity development rules. ALWAYS call list_sanity_rules first to see available rules, then load all rules relevant to your task in a single call.
Parámetros de entrada
rulesstring[]ObligatorioOne or more rule names to load. Use list_sanity_rules to see available rules.
intentstringBriefly 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.
Parámetros de salida
Sin parámetros.
Get schemaSANITY_MCP_GET_SCHEMAAcciónFetch the deployed schema for a project and dataset. Deprecated workspaceName and schemaId selectors remain temporarily available for legacy multi-schema datasets.
SANITY_MCP_GET_SCHEMAAcciónFetch the deployed schema for a project and dataset. Deprecated workspaceName and schemaId selectors remain temporarily available for legacy multi-schema datasets.
Parámetros de entrada
typestringOptional: 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.
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
schemaIdstringDeprecation 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.
projectIdstringObligatorioThe Sanity project ID
workspaceNamestringDeprecation 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.
Parámetros de salida
Sin parámetros.
Get ui contextSANITY_MCP__GET_UI_CONTEXTAcciónReturns UI enrichment data for widgets. When documentId is provided, returns schema fields, deployed Studio URL, and resolved reference previews. When documentId is omitted, returns project-level context only (Studio URL).
SANITY_MCP__GET_UI_CONTEXTAcciónReturns UI enrichment data for widgets. When documentId is provided, returns schema fields, deployed Studio URL, and resolved reference previews. When documentId is omitted, returns project-level context only (Studio URL).
Parámetros de entrada
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
documentIdstringThe document ID to fetch context for. When omitted, returns project-level context only (studio URL).
maxRefDepthintegerMaximum depth for collecting reference IDs from the document (default 2)
documentTypestringThe document _type. When provided, the tool skips fetching the document to infer its type.
workspaceNamestringExact schema workspace name. Not a document type. Omit to use the sole active schema; otherwise the tool looks for "default".
Parámetros de salida
Sin parámetros.
Give sanity feedbackSANITY_MCP_GIVE_SANITY_FEEDBACKAcciónSubmit 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. If the feedback concerns a
Media Library, include its `mediaLibraryId` (and `organizationId` if known).
SANITY_MCP_GIVE_SANITY_FEEDBACKAcciónSubmit 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. If the feedback concerns a Media Library, include its `mediaLibraryId` (and `organizationId` if known).
Parámetros de entrada
intentstringBriefly 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.
messagestringObligatorioDescribe 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.
categorystringenumCategory of feedback to help with triage
tool_errormissing_capabilityconfusing_outputdocumentationsanity_apiotherseveritystringenumHow much this blocked progress. high = completely blocked, medium = workaround needed, low = minor
lowmediumhightoolNamestringThe MCP tool this feedback is about, if any (e.g. "query_documents"). Leave unset for general Sanity feedback.
projectIdstringThe Sanity project ID this feedback relates to, if any. Leave unset for general feedback not tied to a specific project.
mediaLibraryIdstringThe Media Library ID this feedback relates to, if any — the `mediaLibraryId` you passed to a `media_library_*` tool.
organizationIdstringThe organization ID this feedback relates to, if known. Media Libraries belong to an organization rather than a project.
Parámetros de salida
Sin parámetros.
List datasetsSANITY_MCP_LIST_DATASETSAcciónLists all datasets in your Sanity project
SANITY_MCP_LIST_DATASETSAcciónLists all datasets in your Sanity project
Parámetros de entrada
intentstringBriefly 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.
projectIdstringObligatorioThe Sanity project ID
Parámetros de salida
Sin parámetros.
List embeddings indicesSANITY_MCP_LIST_EMBEDDINGS_INDICESAcciónList all available embeddings indices for a dataset
SANITY_MCP_LIST_EMBEDDINGS_INDICESAcciónList all available embeddings indices for a dataset
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
Parámetros de salida
Sin parámetros.
List organizationsSANITY_MCP_LIST_ORGANIZATIONSAcciónLists all organizations the user has access to in Sanity
SANITY_MCP_LIST_ORGANIZATIONSAcciónLists all organizations the user has access to in Sanity
Parámetros de entrada
intentstringBriefly 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.
Parámetros de salida
Sin parámetros.
List projectsSANITY_MCP_LIST_PROJECTSAcciónLists all Sanity projects associated with your account
SANITY_MCP_LIST_PROJECTSAcciónLists all Sanity projects associated with your account
Parámetros de entrada
intentstringBriefly 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.
Parámetros de salida
Sin parámetros.
List releasesSANITY_MCP_LIST_RELEASESAcciónList releases in a dataset. By default returns active and scheduled releases. Use the state filter to find published or archived releases.
SANITY_MCP_LIST_RELEASESAcciónList releases in a dataset. By default returns active and scheduled releases. Use the state filter to find published or archived releases.
Parámetros de entrada
limitintegerMaximum number of releases to return
statestringenumFilter releases by state. If omitted, returns active and scheduled releases (excludes published and archived).
activescheduledpublishedarchivedintentstringBriefly 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.
offsetintegerNumber of releases to skip for pagination
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
Parámetros de salida
Sin parámetros.
List sanity rulesSANITY_MCP_LIST_SANITY_RULESAcciónIMPORTANT: Call this FIRST before any Sanity development work. Returns available best practice rules for schemas, queries, frameworks, and visual editing. You MUST load relevant rules before writing Sanity code.
SANITY_MCP_LIST_SANITY_RULESAcciónIMPORTANT: Call this FIRST before any Sanity development work. Returns available best practice rules for schemas, queries, frameworks, and visual editing. You MUST load relevant rules before writing Sanity code.
Parámetros de entrada
intentstringBriefly 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.
Parámetros de salida
Sin parámetros.
List workspace schemasSANITY_MCP_LIST_WORKSPACE_SCHEMASAcciónDeprecation notice: list_workspace_schemas is deprecated. Use get_schema to inspect the authoritative schema for a dataset. This tool temporarily remains available to list every deployed schema for a project and dataset, grouped by source (MCP-managed, Studio-deployed, or legacy). Duplicate workspace names and multiple Studio applications are expected; each entry includes a schemaId for exact reads with get_schema.
SANITY_MCP_LIST_WORKSPACE_SCHEMASAcciónDeprecation notice: list_workspace_schemas is deprecated. Use get_schema to inspect the authoritative schema for a dataset. This tool temporarily remains available to list every deployed schema for a project and dataset, grouped by source (MCP-managed, Studio-deployed, or legacy). Duplicate workspace names and multiple Studio applications are expected; each entry includes a schemaId for exact reads with get_schema.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
Parámetros de salida
Sin parámetros.
Media assets upload from urlSANITY_MCP_MEDIA_ASSETS_UPLOAD_FROM_URLAcciónDeprecated. Use media_library_upload_from_url with the same arguments. This tool does not start an upload.
SANITY_MCP_MEDIA_ASSETS_UPLOAD_FROM_URLAcciónDeprecated. Use media_library_upload_from_url with the same arguments. This tool does not start an upload.
Parámetros de entrada
urlstringObligatoriouriPublic HTTPS asset URL. Sanity fetches it without additional authentication headers.
sha1stringExpected SHA-1 hash for validation.
titlestringAsset title. Omit to use the filename. Cannot be combined with autoGenerateTitle.
intentstringBriefly 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.
aspectsanyAspect values for a new asset, up to 64 KiB of JSON. Cannot be combined with assetId.
assetIdstringExisting Media Library asset ID to add a new version to. Cannot be combined with aspects.
filenamestringOriginal filename, including extension. Not inferred from the source URL.
assetTypestringenumOptional type override. Omit to detect the type from the source content.
imagevideofilesessionIdstringrequestKeystringuuidOptional 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.
mediaLibraryIdstringObligatorioTarget Media Library ID.
cdnAccessPolicystringenumpublicprivateautoGenerateTitlebooleanGenerate a title from image content during processing. Omit to use the filename. Cannot be combined with title, even when false.
Parámetros de salida
Sin parámetros.
Media library create documentsSANITY_MCP_MEDIA_LIBRARY_CREATE_DOCUMENTSAcciónCreate 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.
SANITY_MCP_MEDIA_LIBRARY_CREATE_DOCUMENTSAcciónCreate 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.
Parámetros de entrada
intentstringBriefly 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.
documentsobject[]ObligatorioArray of documents to create (max 25). Each document must have a type and content, with every document field inside content.
mediaLibraryIdstringObligatorioThe 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`.
Parámetros de salida
Sin parámetros.
Media library discard draftsSANITY_MCP_MEDIA_LIBRARY_DISCARD_DRAFTSAcciónDiscard asset drafts, throwing away unpublished metadata edits and leaving the published asset intact.
SANITY_MCP_MEDIA_LIBRARY_DISCARD_DRAFTSAcciónDiscard asset drafts, throwing away unpublished metadata edits and leaving the published asset intact.
Parámetros de entrada
idsstring[]ObligatorioAsset IDs to discard unpublished metadata edits for (max 25).
intentstringBriefly 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.
mediaLibraryIdstringObligatorioThe 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`.
Parámetros de salida
Sin parámetros.
Media library get documentSANITY_MCP_MEDIA_LIBRARY_GET_DOCUMENTAcciónFetch a single Media Library document by its exact ID. This is a direct ID lookup only - it does not search, filter, or query.
SANITY_MCP_MEDIA_LIBRARY_GET_DOCUMENTAcciónFetch a single Media Library document by its exact ID. This is a direct ID lookup only - it does not search, filter, or query.
Parámetros de entrada
intentstringBriefly 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.
documentIdstringObligatorioThe exact document ID to fetch, e.g. an asset ID, or a `drafts.` prefixed ID for an asset with unpublished metadata edits.
mediaLibraryIdstringObligatorioThe 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`.
Parámetros de salida
Sin parámetros.
Media library get schemaSANITY_MCP_MEDIA_LIBRARY_GET_SCHEMAAcciónGet 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`.
SANITY_MCP_MEDIA_LIBRARY_GET_SCHEMAAcciónGet 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`.
Parámetros de entrada
typestringOptional document type to get the full schema definition for, e.g. "sanity.asset". Omit for an overview of the available types.
intentstringBriefly 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.
mediaLibraryIdstringObligatorioThe 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`.
Parámetros de salida
Sin parámetros.
Media library link assetsSANITY_MCP_MEDIA_LIBRARY_LINK_ASSETSAcciónMake 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`.
SANITY_MCP_MEDIA_LIBRARY_LINK_ASSETSAcciónMake 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`.
Parámetros de entrada
linksobject[]ObligatorioThe assets to link (max 25). Each is processed independently.
intentstringBriefly 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.
datasetstringObligatorioThe target dataset to link the assets into.
projectIdstringObligatorioThe target project ID to link the assets into.
mediaLibraryIdstringObligatorioThe 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`.
Parámetros de salida
Sin parámetros.
Media library listSANITY_MCP_MEDIA_LIBRARY_LISTAcciónLists 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.
SANITY_MCP_MEDIA_LIBRARY_LISTAcciónLists 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.
Parámetros de entrada
intentstringBriefly 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.
organizationIdstringObligatorioThe organization ID to list Media Libraries for (as returned by `list_organizations`).
Parámetros de salida
Sin parámetros.
Media library list asset referencesSANITY_MCP_MEDIA_LIBRARY_LIST_ASSET_REFERENCESAcciónLists documents (across project datasets) that reference a Media Library asset. Use this before replacing an asset to see what depends on it.
SANITY_MCP_MEDIA_LIBRARY_LIST_ASSET_REFERENCESAcciónLists documents (across project datasets) that reference a Media Library asset. Use this before replacing an asset to see what depends on it.
Parámetros de entrada
cursorstringPagination cursor (`nextCursor`) from a previous response.
intentstringBriefly 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.
assetIdstringObligatorioThe published asset container ID (`sanity.asset` `_id`, without a `drafts.` prefix) to find references for. References always point at the published asset.
mediaLibraryIdstringObligatorioThe 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`.
Parámetros de salida
Sin parámetros.
Media library patch documentsSANITY_MCP_MEDIA_LIBRARY_PATCH_DOCUMENTSAcciónEdit 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.
SANITY_MCP_MEDIA_LIBRARY_PATCH_DOCUMENTSAcciónEdit 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.
Parámetros de entrada
intentstringBriefly 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.
documentsobjectObligatorioMap 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.
mediaLibraryIdstringObligatorioThe 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`.
Parámetros de salida
Sin parámetros.
Media library publish documentsSANITY_MCP_MEDIA_LIBRARY_PUBLISH_DOCUMENTSAcciónPublish 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.
SANITY_MCP_MEDIA_LIBRARY_PUBLISH_DOCUMENTSAcciónPublish 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.
Parámetros de entrada
idsstring[]ObligatorioAsset IDs to publish metadata edits for (max 25). Draft or published IDs both work.
intentstringBriefly 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.
mediaLibraryIdstringObligatorioThe 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`.
Parámetros de salida
Sin parámetros.
Media library query documentsSANITY_MCP_MEDIA_LIBRARY_QUERY_DOCUMENTSAcciónQuery 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.
SANITY_MCP_MEDIA_LIBRARY_QUERY_DOCUMENTSAcciónQuery 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.
Parámetros de entrada
limitintegerMaximum number of documents to return
querystringObligatorioComplete GROQ query (e.g. "*[_type == \"sanity.asset\"][0...10]{_id, title}")
intentstringBriefly 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.
paramsobjectOptional parameters for the GROQ query
perspectivestringenumOptional 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.
rawdraftspublishedmediaLibraryIdstringObligatorioThe 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`.
Parámetros de salida
Sin parámetros.
Media library upload from fileSANITY_MCP_MEDIA_LIBRARY_UPLOAD_FROM_FILEAcciónPrepare 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.
SANITY_MCP_MEDIA_LIBRARY_UPLOAD_FROM_FILEAcciónPrepare 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.
Parámetros de entrada
sha1stringExpected SHA-1 hash for validation.
typestringObligatorioenumType of asset being uploaded.
imagevideofiletitlestringAsset title. Omit to use the filename. Cannot be combined with autoGenerateTitle.
intentstringBriefly 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.
aspectsanyAspect values for a new asset, up to 64 KiB of JSON. Cannot be combined with assetId.
assetIdstringExisting Media Library asset ID to add a new version to. Cannot be combined with aspects.
filenamestringObligatorioOriginal filename, including extension.
sessionIdstringmediaLibraryIdstringObligatorioTarget Media Library ID.
cdnAccessPolicystringenumpublicprivateautoGenerateTitlebooleanGenerate a title from image content during processing. Omit to use the filename. Cannot be combined with title, even when false.
Parámetros de salida
methodstringObligatoriomaxBytesnumberObligatoriouploadUrlstringObligatorioinstructionsstringObligatoriouploadExpiresAtstringObligatorio
Media library upload from urlSANITY_MCP_MEDIA_LIBRARY_UPLOAD_FROM_URLAcciónStart 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`.
SANITY_MCP_MEDIA_LIBRARY_UPLOAD_FROM_URLAcciónStart 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`.
Parámetros de entrada
urlstringObligatoriouriPublic HTTPS asset URL. Sanity fetches it without additional authentication headers.
sha1stringExpected SHA-1 hash for validation.
titlestringAsset title. Omit to use the filename. Cannot be combined with autoGenerateTitle.
intentstringBriefly 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.
aspectsanyAspect values for a new asset, up to 64 KiB of JSON. Cannot be combined with assetId.
assetIdstringExisting Media Library asset ID to add a new version to. Cannot be combined with aspects.
filenamestringOriginal filename, including extension. Not inferred from the source URL.
assetTypestringenumOptional type override. Omit to detect the type from the source content.
imagevideofilesessionIdstringrequestKeystringuuidOptional 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.
mediaLibraryIdstringObligatorioTarget Media Library ID.
cdnAccessPolicystringenumpublicprivateautoGenerateTitlebooleanGenerate a title from image content during processing. Omit to use the filename. Cannot be combined with title, even when false.
Parámetros de salida
erroranyresultobjectstatusstringObligatorioenumrunningcompletedfailedunknownmessagestringexpiresAtstringObligatoriooperationIdstringObligatoriopollAfterMsnumber
Patch documentsSANITY_MCP_PATCH_DOCUMENTSAcciónUpdate existing documents with @sanity/client patch() operations. Set documents to an object keyed by document ID, such as {"article-1":{"patches":[{"set":{"title":"New title"}}]}}.
Each document’s patches are applied as one transaction. Send at most 25 documents per call; split larger updates into more calls. Edits are saved to the draft or release version, never directly to published content.
For release edits, create the version first, then patch its versions.{releaseId}.* ID with the same releaseId. Do not patch the published ID before creating the release version.
SANITY_MCP_PATCH_DOCUMENTSAcciónUpdate existing documents with @sanity/client patch() operations. Set documents to an object keyed by document ID, such as {"article-1":{"patches":[{"set":{"title":"New title"}}]}}. Each document’s patches are applied as one transaction. Send at most 25 documents per call; split larger updates into more calls. Edits are saved to the draft or release version, never directly to published content. For release edits, create the version first, then patch its versions.{releaseId}.* ID with the same releaseId. Do not patch the published ID before creating the release version.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
documentsobjectObligatorioMap 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.
projectIdstringObligatorioThe Sanity project ID
releaseIdstringOptional release ID for patching documents in an existing release.
workspaceNamestringDeprecation 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".
Parámetros de salida
Sin parámetros.
Publish documentsSANITY_MCP_PUBLISH_DOCUMENTSAcciónPublish one or more drafts. Set ids to an array such as [{"id":"article-1"}]. Use the exact IDs returned by create_documents, query_documents, or get_document.
SANITY_MCP_PUBLISH_DOCUMENTSAcciónPublish one or more drafts. Set ids to an array such as [{"id":"article-1"}]. Use the exact IDs returned by create_documents, query_documents, or get_document.
Parámetros de entrada
idsobject[]ObligatorioDocuments to publish, one entry per document: each publishes that document's current draft.
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
workspaceNamestringDeprecation 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".
Parámetros de salida
Sin parámetros.
Query documentsSANITY_MCP_QUERY_DOCUMENTSAcciónQuery documents from Sanity using GROQ. Pass only the GROQ string in query. Do not include JavaScript imports, template wrappers, or defineQuery(). When using variables, set params to a JSON object such as {"type":"post"}.
Results are not truncated. A result larger than 64 KiB is rejected with an error instead. Use field projections and GROQ slices to request only what you need, and fetch large result sets in batches, for example by slicing ordered by _id and filtering with _id > $after.
For unfamiliar GROQ syntax, functions, or query patterns, fetch get_sanity_rules({rules: ["groq"]}) before proceeding.
SANITY_MCP_QUERY_DOCUMENTSAcciónQuery documents from Sanity using GROQ. Pass only the GROQ string in query. Do not include JavaScript imports, template wrappers, or defineQuery(). When using variables, set params to a JSON object such as {"type":"post"}. Results are not truncated. A result larger than 64 KiB is rejected with an error instead. Use field projections and GROQ slices to request only what you need, and fetch large result sets in batches, for example by slicing ordered by _id and filtering with _id > $after. For unfamiliar GROQ syntax, functions, or query patterns, fetch get_sanity_rules({rules: ["groq"]}) before proceeding.
Parámetros de entrada
querystringObligatorioComplete 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.
intentstringBriefly 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.
paramsobjectOptional parameters for the GROQ query as a JSON object
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
perspectiveanyOptional 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.
Parámetros de salida
Sin parámetros.
Read docsSANITY_MCP_READ_DOCSAcciónRead a specific Sanity documentation article
SANITY_MCP_READ_DOCSAcciónRead a specific Sanity documentation article
Parámetros de entrada
urlstringuriFull URL to the documentation page (e.g., "https://www.sanity.io/docs/studio/installation")
pathstringPath to the documentation page (e.g., "/docs/studio/installation" or "/changelog/studio-Ni41LjA")
intentstringBriefly 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.
Parámetros de salida
Sin parámetros.
Run sanity cliSANITY_MCP_RUN_SANITY_CLIAcciónRun a limited subset of Sanity CLI commands and return their output. Prefer dedicated Sanity MCP tools when possible, use CLI as a fallback for special cases. 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.
SANITY_MCP_RUN_SANITY_CLIAcciónRun a limited subset of Sanity CLI commands and return their output. Prefer dedicated Sanity MCP tools when possible, use CLI as a fallback for special cases. 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.
Parámetros de entrada
argsstringObligatorioArguments passed to the Sanity CLI after `sanity`, as a single string. Examples: `--help`, `datasets list --project-id <project-id>`. This tool has no project directory, so include `--project-id <project-id>` for project-scoped commands.
intentstringBriefly 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.
Parámetros de salida
Sin parámetros.
Schema fields patchSANITY_MCP_SCHEMA_FIELDS_PATCHAcciónAdd, 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 preview the change 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.
SANITY_MCP_SCHEMA_FIELDS_PATCHAcciónAdd, 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 preview the change 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.
Parámetros de entrada
dryRunbooleanintentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
typeNamestringObligatorioprojectIdstringObligatorioThe Sanity project ID
allowLossybooleanDeprecated and ignored. Edits now preserve fields and types they do not change, so there are no conversion losses to accept.
operationsarrayObligatorioUpsert or delete top-level fields in the named type.
confirmDeployTakeoverbooleanConfirm an explicitly authorized takeover of a Studio deployment.
expectedSchemaVersionstringObligatorioCurrent schemaVersion returned by schema_type_get. Required to reject stale edits.
Parámetros de salida
Sin parámetros.
Schema type getSANITY_MCP_SCHEMA_TYPE_GETAcciónRead 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.
SANITY_MCP_SCHEMA_TYPE_GETAcciónRead 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.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
typeNamestringObligatorioName of the schema type to edit.
projectIdstringObligatorioThe Sanity project ID
Parámetros de salida
Sin parámetros.
Schema types deleteSANITY_MCP_SCHEMA_TYPES_DELETEAcciónRemove 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 preview the change 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.
SANITY_MCP_SCHEMA_TYPES_DELETEAcciónRemove 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 preview the change 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.
Parámetros de entrada
dryRunbooleanintentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
typeNamesstring[]ObligatorioNames of types to remove together.
allowLossybooleanDeprecated and ignored. Edits now preserve fields and types they do not change, so there are no conversion losses to accept.
confirmDeployTakeoverbooleanConfirm an explicitly authorized takeover of a Studio deployment.
expectedSchemaVersionstringObligatorioCurrent schemaVersion returned by schema_type_get. Required to reject stale edits.
Parámetros de salida
Sin parámetros.
Search docsSANITY_MCP_SEARCH_DOCSAcciónSearch Sanity docs
SANITY_MCP_SEARCH_DOCSAcciónSearch Sanity docs
Parámetros de entrada
limitintegerMaximum number of results to return (default: 10, max: 50)
querystringObligatorioThe search query for documentation
intentstringBriefly 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.
Parámetros de salida
Sin parámetros.
Semantic searchSANITY_MCP_SEMANTIC_SEARCHAcciónPerform a semantic search on an embeddings index
SANITY_MCP_SEMANTIC_SEARCHAcciónPerform a semantic search on an embeddings index
Parámetros de entrada
limitintegerMaximum number of results to return
querystringObligatorioThe search query to find semantically similar content
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
indexNamestringObligatorioThe name of the embeddings index to search
projectIdstringObligatorioThe Sanity project ID
Parámetros de salida
Sin parámetros.
Transform imageSANITY_MCP_TRANSFORM_IMAGEAcciónTransform an existing image in a document using AI. When targeting a published document, this creates or updates a draft with the transformed image (published document remains unchanged). The draft must be published separately to make changes live. Note: Image transformation is asynchronous and completes in the background.
SANITY_MCP_TRANSFORM_IMAGEAcciónTransform an existing image in a document using AI. When targeting a published document, this creates or updates a draft with the transformed image (published document remains unchanged). The draft must be published separately to make changes live. Note: Image transformation is asynchronous and completes in the background.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
imagePathstringObligatorioPath to the image field in the document (e.g., "image", "hero.image"). For image arrays, target with _key filtering: "images[_key==\"img1\"]".
projectIdstringObligatorioThe Sanity project ID
documentIdstringObligatorioThe ID of the document containing the image
instructionstringObligatorioNatural 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.
workspaceNamestringDeprecation 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".
Parámetros de salida
Sin parámetros.
Undeploy schemaSANITY_MCP_UNDEPLOY_SCHEMAAcciónRemove 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.
SANITY_MCP_UNDEPLOY_SCHEMAAcciónRemove 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.
Parámetros de entrada
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
workspaceNamestringObligatorioExact workspace name to undeploy. Use get_schema to inspect the deployed schema first.
Parámetros de salida
Sin parámetros.
Unpublish documentsSANITY_MCP_UNPUBLISH_DOCUMENTSAcciónUnpublish one or more published documents (moves them back to drafts), or provide releaseId to mark them for unpublishing when that release runs. Cannot immediately unpublish documents that are referenced by other documents.
SANITY_MCP_UNPUBLISH_DOCUMENTSAcciónUnpublish one or more published documents (moves them back to drafts), or provide releaseId to mark them for unpublishing when that release runs. Cannot immediately unpublish documents that are referenced by other documents.
Parámetros de entrada
idsstring[]ObligatorioIDs of the documents to unpublish. Without releaseId, provide published IDs only.
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
releaseIdstringOptional release ID for scheduling documents to be unpublished when the release runs
Parámetros de salida
Sin parámetros.
Update datasetSANITY_MCP_UPDATE_DATASETAcciónUpdate an existing dataset's visibility (public or private) and description. Public datasets allow unauthenticated reads. Pass null to clear the description. The dataset name identifies the target and cannot be changed by this tool.
SANITY_MCP_UPDATE_DATASETAcciónUpdate an existing dataset's visibility (public or private) and description. Public datasets allow unauthenticated reads. Pass null to clear the description. The dataset name identifies the target and cannot be changed by this tool.
Parámetros de entrada
intentstringBriefly 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.
aclModestringenumThe ACL mode for the dataset
privatepublicdatasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
descriptionanyA brief description of the dataset purpose. Pass null to clear.
Parámetros de salida
Sin parámetros.
Usage history getSANITY_MCP_USAGE_HISTORY_GETAcciónGet 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.
SANITY_MCP_USAGE_HISTORY_GETAcciónGet 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.
Parámetros de entrada
tostringLast 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.
fromstringFirst 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.
scopestringBreak usage down by this scope instead of returning resource totals. Currently the API supports "user" (per-user usage).
intentstringBriefly 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.
periodstringenumSize 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.
daymonthyearmetricsstring[]Metric names to return, such as ["apirequests", "apicdnrequests", "documents", "assets"]. Omit to return every metric. Call once without this to discover the available names.
cumulativebooleanAlso return a running total for counter metrics. Not supported with scope.
resourceIdstringObligatorioID of the project, organization or media library. Get project and organization IDs from list_projects or list_organizations.
resourceTypestringObligatorioenumType of resource to read usage for
projectorganizationmedia-librarycumulativePeriodstringenumWhen the running total resets to 0, locked to the calendar. Defaults to forever. Only used with cumulative.
daymonthyearforever
Parámetros de salida
Sin parámetros.
Usage snapshot getSANITY_MCP_USAGE_SNAPSHOT_GETAcciónGet 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.
SANITY_MCP_USAGE_SNAPSHOT_GETAcciónGet 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.
Parámetros de entrada
datestringDate to read the snapshot for, such as 2026-09-14. Defaults to today.
scopestringBreak usage down by this scope instead of returning resource totals. Currently the API supports "user" (per-user usage).
intentstringBriefly 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.
periodstringenumBilling 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.
daymonthyearmetricsstring[]Metric names to return, such as ["apirequests", "apicdnrequests", "documents", "assets"]. Omit to return every metric. Call once without this to discover the available names.
resourceIdstringObligatorioID of the project, organization or media library. Get project and organization IDs from list_projects or list_organizations.
resourceTypestringObligatorioenumType of resource to read usage for
projectorganizationmedia-librarysnapshotPeriodstringenumstartOfPeriod (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.
startOfPeriodpreviousPeriod
Parámetros de salida
Sin parámetros.
Version discardSANITY_MCP_VERSION_DISCARDAcciónDiscard one or more document versions from a release
SANITY_MCP_VERSION_DISCARDAcciónDiscard one or more document versions from a release
Parámetros de entrada
idsstring[]ObligatorioDocument IDs to discard from the release
intentstringBriefly 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.
datasetstringObligatorioThe name of the dataset in the project
projectIdstringObligatorioThe Sanity project ID
releaseIdstringObligatorioID of the release to discard the document versions from
Parámetros de salida
Sin parámetros.
WhoamiSANITY_MCP_WHOAMIAcciónReturns the currently authenticated Sanity account. Use it first for access or account troubleshooting and report the returned name, email, provider, and MCP authentication method so the user can verify which identity is active.
SANITY_MCP_WHOAMIAcciónReturns the currently authenticated Sanity account. Use it first for access or account troubleshooting and report the returned name, email, provider, and MCP authentication method so the user can verify which identity is active.
Parámetros de entrada
intentstringBriefly 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.
Parámetros de salida
Sin parámetros.