Tools
This is a reference catalogue. Tools cannot be configured or run from this page.
Get schema
SANITY_MCP_GET_SCHEMAFetch the deployed schema for a project and dataset. Deprecated workspaceName and schemaId selectors remain temporarily available for legacy multi-schema datasets.
Get ui context
SANITY_MCP__GET_UI_CONTEXTReturns 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).
Give sanity feedback
SANITY_MCP_GIVE_SANITY_FEEDBACKSubmit 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).
List datasets
SANITY_MCP_LIST_DATASETSLists all datasets in your Sanity project
List embeddings indices
SANITY_MCP_LIST_EMBEDDINGS_INDICESList all available embeddings indices for a dataset
List organizations
SANITY_MCP_LIST_ORGANIZATIONSLists all organizations the user has access to in Sanity
List projects
SANITY_MCP_LIST_PROJECTSLists all Sanity projects associated with your account
List releases
SANITY_MCP_LIST_RELEASESList releases in a dataset. By default returns active and scheduled releases. Use the state filter to find published or archived releases.
List sanity rules
SANITY_MCP_LIST_SANITY_RULESIMPORTANT: 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.
List workspace schemas
SANITY_MCP_LIST_WORKSPACE_SCHEMASDeprecation 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.
Media assets upload from url
SANITY_MCP_MEDIA_ASSETS_UPLOAD_FROM_URLDeprecated. Use media_library_upload_from_url with the same arguments. This tool does not start an upload.
Media library create documents
SANITY_MCP_MEDIA_LIBRARY_CREATE_DOCUMENTSCreate 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.
Media library discard drafts
SANITY_MCP_MEDIA_LIBRARY_DISCARD_DRAFTSDiscard asset drafts, throwing away unpublished metadata edits and leaving the published asset intact.
Media library get document
SANITY_MCP_MEDIA_LIBRARY_GET_DOCUMENTFetch a single Media Library document by its exact ID. This is a direct ID lookup only - it does not search, filter, or query.
Media library get schema
SANITY_MCP_MEDIA_LIBRARY_GET_SCHEMAGet 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`.
Media library link assets
SANITY_MCP_MEDIA_LIBRARY_LINK_ASSETSMake 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`.
Media library list
SANITY_MCP_MEDIA_LIBRARY_LISTLists 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.
Media library list asset references
SANITY_MCP_MEDIA_LIBRARY_LIST_ASSET_REFERENCESLists documents (across project datasets) that reference a Media Library asset. Use this before replacing an asset to see what depends on it.
Media library patch documents
SANITY_MCP_MEDIA_LIBRARY_PATCH_DOCUMENTSEdit 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.
Media library publish documents
SANITY_MCP_MEDIA_LIBRARY_PUBLISH_DOCUMENTSPublish 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.