SanityAI3 MIN READ
15.03.2026
.md

Using the WAT Framework: Writing Sanity MCP Workflows That Make Claude Consistent and Reliable

Last updated: 15.03.2026

🎧

Using the WAT Framework: Writing Sanity MCP Workflows That Make Claude Consistent and Reliable

Audio Narration

Ai genreated image wat workflow

The Problem With Asking AI to "Just Figure It Out"

When you give Claude an open-ended task like "write a blog post about TypeScript," you get a different result every time. The structure varies. Fields get missed. Edge cases are ignored. That's not a bug — it's the nature of probabilistic reasoning. Without constraints, the model explores a wide solution space. For repetitive, structured tasks like publishing content to a CMS, that's a liability.

What the WAT Framework Is

WAT stands for Workflows, Agents, Tools. It's a three-layer architecture that separates concerns: Workflows are plain-language markdown SOPs that define what needs to happen and how. Agents — Claude — handle reasoning, sequencing, and decision-making. Tools are deterministic scripts or APIs (like the Sanity MCP) that do the actual execution. Each layer does what it does best. The workflow encodes your domain knowledge. Claude handles judgment calls. The tools handle the mechanics.

Why Workflows Make AI Better

A workflow narrows the decision space. Instead of reasoning from scratch each time, Claude follows a defined path: collect inputs, fetch context, draft an outline, get approval, write content, create the document. Every step is explicit. Edge cases are handled in advance. The result is consistent, repeatable behavior — more like a reliable colleague following a process than a creative generalist making it up as they go. If each step is 90% accurate and you have five steps, an improvised chain lands at 59% success. A workflow keeps you close to 90% at every step.

Building a Sanity MCP Workflow

The draft_blog_post workflow is a practical example. It starts by fetching authors and categories from Sanity via GROQ so references are always valid. It requires outline approval before writing — a quality gate that prevents wasted effort. The document shape is specified exactly: the Portable Text body structure, SEO fields, what not to set (autoSummary is generated on publish). Discovered constraints get documented too, like the 5000-byte body limit imposed by the audio narration pipeline.

The Self-Improvement Loop

Workflows are not static. When you hit a slug conflict, you add a rule: append -draft. When you discover the body size limit, you document it and add a trimming instruction. Each failure makes the workflow stronger. Over time it accumulates hard-won knowledge about your specific setup — knowledge that would otherwise live only in your head or get rediscovered every session.

Getting Started With Your Own Workflows

A good workflow starts with a repeatable task you find yourself explaining more than once. Write down the inputs, the steps, which tools to call, and the expected output. Add an edge cases table as you encounter them. Store it in .claude/wat/workflows/ and reference it by name when you start a task. The payoff compounds: every session that follows the workflow is faster, more consistent, and cheaper than one that improvises from scratch.

Continue Reading
A closed notebook with a wrench, a magnifying glass and a ruler tucked under its elastic band.
AI3 MIN

My blog has tools now: WebMCP for browser agents

The blog builds on its Markdown-first approach by adding WebMCP, a draft W3C technology that lets web pages expose structured tools to browser-based agents. Rather than forcing an agent to inspect pages, infer URLs, and construct requests, WebMCP provides a concise list of callable tools registered through `document.modelContext.registerTool()`. Chrome supports it experimentally through an origin trial beginning with version 149. Every page on the blog offers three read-only tools: `list_posts`, which returns recent posts with optional category and limit filters; `get_post`, which retrieves a post’s full Markdown by slug; and `list_categories`, which lists categories and post counts. These tools simply fetch existing public Markdown endpoints, so the same information remains accessible without WebMCP. Users can inspect and invoke the tools in Chrome DevTools under Application > WebMCP or query them from the console. Agents can also access them through Chrome DevTools MCP, while an inspector extension supports prompting with Gemini. However, current access depends on flags, experimental options, or an origin trial, and tools are visible only while a page is open. Keeping them as thin wrappers ensures the blog remains functional if WebMCP changes or disappears.

Read post
A school report card with a pie chart, 68 shaded in teal and the rest filled in with red pen to make 100.
AISEOClaude4 MIN

From 68 to 100: making my blog readable for AI agents

Is Agentic is a free tool that evaluates how accessible a website is to AI agents. It scans a URL, assigns a score out of 100, provides supporting evidence, and recommends fixes across essential, recommended, and bonus checks. The author’s blog initially scored 68. Using the report and Claude Code, the author added Markdown versions of posts, listings, the homepage, and error pages so agents could access content and recover from broken links more easily. Other improvements included structured data identifying the site and author, a clearer title, properly ordered headings, and an updated llms.txt file explaining when the personal blog is an appropriate source. Reviewing the site from an agent’s perspective also revealed a hidden linking bug: Markdown posts pointed to nonexistent /post/ URLs instead of /posts/. After fixes, the site scored 100, although that total included bonus points and concealed two recommended-check gaps. Contact and Privacy pages were added, while one search-ranking check remains unresolved because its results differ from Google’s. Website owners can test their own sites at is-agentic.com, prioritize failed essential checks, implement fixes, and rescan. Reports retain the same shareable URL while displaying the latest results.

Read post