Manage and upload Media Library assets with MCP
Published: October 2, 2026
v2.40.0
New Features
- Media Library tools: Find assets, inspect their schemas and metadata, edit and organize documents, manage drafts, check where assets are used, and link assets to Content Lake datasets.
media_library_upload_from_filetool: Upload local images, videos, and files up to 50 MiB to a Media Library, or add a new version to an existing asset.
Improvements
- Failed tool results now include a stable error code in
_meta["io.sanity/errorCode"], so clients can identify failures without parsing error messages. Document tool errors also give clearer guidance on how to recover. - Media Library uploads that find duplicate content preserve the existing asset ID, so agents can inspect the asset before retrying.
patch_documentsnow returns a permissions error immediately when a document exists but the current role or token cannot read it.
Breaking changes
dataset_assets_upload_from_file uploads now return a compact asset summary and document reference instead of the full asset document. Set includeMetadata: true when preparing the upload to receive the full document, including extracted metadata such as LQIP, palette, blurHash, and thumbHash.
media_library_upload_from_url no longer accepts parent or rootDirectory. It uses the filename as the title by default. Set autoGenerateTitle: true to request title generation.