• PATCHED
  • MUTATED
  • REVIEW
  • VERIFIED

How to perform bulk content updates with your AI

Connect Sanity to your AI client to execute targeted changes across your entire dataset. Once connected, your agent handles the heavy lifting of document manipulation.

Ask AI about this page

Short answer

How can I use my AI to update multiple Sanity documents at once?

Your AI uses specific tools to target individual documents or run raw mutations across your dataset. This allows you to change fields, update metadata, or restructure content without manual entry for every record. You'll see the results directly in your Sanity studio.

The outcomes.

Where your changes land.

Depending on your request, the AI will produce one of these outcomes.

PATCHED

Targeted field updates

The AI modifies specific fields in existing documents. You get clean, precise changes to titles, slugs, or custom metadata.

MUTATED

Complex data changes

The AI runs raw mutations to handle more advanced logic. This is how you perform structural changes that go beyond simple field edits.

REVIEW

Human oversight needed

For high-stakes changes or complex logic, the AI identifies where you need to step in. You maintain control over the final state of your content.

VERIFIED

Data integrity check

The AI confirms the changes were applied to the correct document IDs. You can verify the state of your Sanity dataset immediately.

The workflow

What your AI does when the request arrives.

The AI translates your natural language instructions into precise Sanity operations.

  1. Identify targets

    The AI scans your Sanity dataset to find the specific documents you want to change based on your description.

    patch_cms_document
  2. Apply field changes

    The AI updates specific properties within the identified documents to match your new requirements.

    patch_cms_document
  3. Execute mutations

    For more complex or bulk operations, the AI sends raw mutation commands to the Sanity API.

    run_raw_mutation
  4. Confirm success

    The AI verifies that the requested changes were successfully written to the CMS.

    patch_cms_documentrun_raw_mutation

Try it

Copy these to start.

Use these prompts to trigger your first bulk update.

Starting points

Swap out the bracketed text for your actual Sanity document types or field names.

Sanity Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_kOcJmNXuW6tXc9VymiA6CmKfU4tOyRvWsv6XMmO3/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Sanity capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "sanity-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_kOcJmNXuW6tXc9VymiA6CmKfU4tOyRvWsv6XMmO3/mcp"
    }
  }
}
Copy into chat04
  • Update the meta.title for all documents of type 'product' to follow the format 'New Product Name'.

  • Find all 'article' documents where the status is 'draft' and change the status field to 'published'.

  • Run a mutation to add a new category tag to every document in the 'blogPost' collection.

  • Change the slug for all 'category' documents that have an empty slug field.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Sanity once, then ask.

Just link your Sanity project to the MCP. Your credentials stay encrypted, and you can start sending commands to your dataset immediately.

Connect Sanity to your AI

FAQ

How this task behaves.

  • 01

    Can the AI delete documents from my Sanity studio?

    No. The available tools only allow for patching existing documents or running mutations. It cannot perform delete operations.

  • 02

    Will the AI change my content schema?

    No. The AI can only update the data within your existing schema. It cannot add new fields to your schema definitions.

  • 03

    How does the AI know which documents to update?

    It uses the information you provide in your prompt to identify the correct document types and field values.

  • 04

    Can I undo a bulk update performed by the AI?

    The AI does not have an undo feature. You should verify changes in your Sanity studio or rely on your own CMS history.

  • 05

    Does the AI work with all Sanity fields?

    Yes, as long as the field exists in your current schema, the AI can target it for updates.

  • More questions about Sanity? See everything the Sanity Connector can do

Connect Sanity to Claude, Cursor, ChatGPT & more