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_file tool: 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_documents now returns a permissions error immediately when a document exists but the current role or token cannot read it.

Breaking changes

Related documentation

Loading...
Manage and upload Media Library assets with MCP | Sanity Docs