Skip to content

/deploy-schema

Deploy Sanity schema to the Content Lake with verification.

From plugin
sanity
1974 skills4 commands1 MCP
> /plugin marketplace add sanity-io/agent-toolkit
> /plugin install sanity@sanity-agent-toolkit

Command definition

deploy-schema.md
name: deploy-schema
description: Deploy Sanity schema to the Content Lake with verification.

Deploy Sanity Schema

I'll help you deploy your schema to the Sanity Content Lake.

Why Deploy Schema?

Schema deployment is **required** for:

  • ⚠️ **MCP Server content operations** (`create_documents`, `patch_documents`) to use the latest schema
  • Embedded Studios
  • Scheduled Publishing
  • Cloud Functions with schema validation

Deployment Command

npx sanity schemas deploy

What I'll Do

1. **Pre-Deploy Check**

  • Verify schema syntax (run typegen)
  • Check for breaking changes
  • Warn about removed fields with data

2. **Deploy**

  • Run `npx sanity schemas deploy`
  • Confirm success

3. **Post-Deploy Verification**

  • Use MCP `get_schema` to verify deployment
  • Confirm new types/fields are available

When to Deploy

| Scenario | Deploy? | |----------|---------| | Added new document type | ✅ Yes | | Added/modified fields | ✅ Yes | | Changed validation rules | ✅ Yes | | Using MCP content tools after schema changes | ✅ Yes | | Local dev only (no MCP) | Optional |

Important Notes

  • **Schema deployment is fast** (~2 seconds)
  • **Does NOT deploy the Studio app** (use `npx sanity deploy` for that)
  • **Always deploy before MCP content operations** after schema changes

Usage

> "Deploy my schema" > "Check if my schema is deployed" > "Why can't MCP see my new field?"

Read more
@sanity-io
Ships withsanity

Collection of resources to help AI agents build better with Sanity.

Stars on GitHub

Momentum

stars in total
197
Star history of sanity-io/agent-toolkit on GitHub, a chart by star-history.com

Other commands on sanity.

typegen
Auto-invoked

typegen

Command

Run Sanity TypeGen and troubleshoot type generation issues.

@sanity-io@sanity-ioInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command