• SCHEMA
  • MEDIA
  • DETAILS
  • HUMAN

How to audit Sanity schema and assets with your AI

Connect your Sanity project to your AI agent to map out your content structure and file library. Once connected, you can run audits on your schema and media without manual digging.

Ask AI about this page

Short answer

How can I audit my Sanity schema and assets with AI?

Your AI agent uses the Sanity MCP to pull a list of every unique document type and every media asset in your project. You can then ask it to inspect specific documents to find inconsistencies or missing files.

Audit outcomes.

Where your data lands.

The AI organizes your Sanity data into these specific views.

SCHEMA

Document type maps

The AI identifies every unique document type in your project. You get a clean list of your content models to check for bloat or unused types.

MEDIA

Asset inventories

The agent pulls a full list of your media assets. This helps you spot orphaned files or large uploads that need attention.

DETAILS

Deep document dives

You can request specific data from any document. The AI pulls the exact fields and values you need to verify content accuracy.

HUMAN

Manual cleanup

The AI identifies the issues, but you still handle the actual deletions or schema changes in the Sanity Studio. It provides the intelligence, you provide the action.

The workflow

What your AI does when the request arrives.

The AI moves through your Sanity project by calling specific tools to gather the data you asked for.

  1. Map the schema

    The agent scans your project to find every unique document type currently in use.

    list_unique_schema_types
  2. Inventory media

    The AI crawls your asset library to list all uploaded files and images.

    list_media_assets
  3. Inspect content

    When you ask about a specific entry, the agent pulls the full field data for that document.

    get_document_details
  4. Report findings

    The agent compares the schema and assets against your questions to highlight discrepancies.

    get_document_detailslist_media_assets

Try it

Copy these to start.

Use these prompts to begin your audit.

Starting points

These are starting points. Swap out the specific document types or asset names to match your actual Sanity project.

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
  • List all the unique document types in my Sanity project.

  • Show me a list of all media assets currently in my project.

  • Get the details for the document with the ID 'blog-post-123' so I can check its fields.

  • Compare my media assets to my 'product' document types and tell me if anything looks missing.

  • 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 immediately start asking questions about your data in your preferred AI client.

Connect Sanity to your AI

FAQ

How the audit behaves

  • 01

    Can the AI delete documents or assets for me?

    No. The AI can only read and list your schema, assets, and document details. You must perform all deletions or edits manually in Sanity.

  • 02

    Can the AI change my schema definitions?

    No. The AI can list your unique schema types, but it does not have the capability to modify your code or schema files.

  • 03

    Does the AI see all my content?

    The AI can see any document or asset it has permission to access via the tools provided. It only sees what you ask it to look at.

  • 04

    Can I use this with any AI client?

    Yes, as long as the client is MCP-compatible, like Claude, Cursor, or Windsurf.

  • 05

    How does the AI know which documents to check?

    You tell it. You can provide a specific document ID or ask it to scan all types using the available tools.

  • More questions about Sanity? The Connector page answers them. See everything the Sanity Connector can do

Connect Sanity to Claude, Cursor, ChatGPT & more