Connect Sanity to Your AI Agent

Use AI with Sanity to query Content Lake documents, read current versions and apply explicit mutation transactions.

3 tools API key

Try a Sanity Task

Copy a prompt into your agent with the oo Skill installed. Add your page links and source notes before running it.

oo Skill Sanity

Research CMS Documents

Run a scoped GROQ query and read selected current documents by ID.

/oo Sanity: Query dataset [dataset] with GROQ [query], then get document IDs [IDs] and summarize their content.

Preview a Mutation Transaction

Run an explicit mutation transaction in dry-run mode.

/oo Sanity: Preview mutations [JSON] in dataset [dataset] using dryRun true, and explain the returned result.

Start Working with Sanity

  1. Install OOMOL

    Set up oo CLI and the oo Skill in your agent.

    Install OOMOL →
  2. Connect Sanity

    Provide a Sanity robot or personal API token and Project ID.

    Connect Sanity →
  3. Give Your Agent a Task

    Use /oo with the pages to read, the changes to make, and where to save the result.

    Connection Guide →

Choose Your Agent

  • Dataset access with appropriate read or mutation permissions.
  • Specify dataset and GROQ query or mutations. Mutation transactions can change or delete documents; dryRun previews the transaction without applying it.

Sanity Tools

Use AI with Sanity to query Content Lake documents, read current versions and apply explicit mutation transactions.

Research CMS Documents

Run a scoped GROQ query and read selected current documents by ID.

Preview a Mutation Transaction

Run an explicit mutation transaction in dry-run mode.

3 tools

Query Documents

Run a GROQ query against a Sanity Content Lake dataset.

sanity.query_documents

Get Documents

Retrieve the latest Sanity documents by ID while bypassing the query cache.

sanity.get_documents

Mutate Documents

Execute an atomic transaction of Sanity document mutations.

sanity.mutate_documents

Frequently Asked Questions

Can I preview mutations first?

Yes. Set dryRun true when submitting the mutation transaction.

Does document lookup use the query cache?

get_documents retrieves latest documents by ID while bypassing the query cache.

What should I specify in my request?

Specify dataset and GROQ query or mutations. Mutation transactions can change or delete documents; dryRun previews the transaction without applying it.

Connect Sanity

About Sanity ↗