Player not loading? Watch on YouTube
This tutorial builds a CLI AI agent that recommends board games using structured BoardGameGeek records. Jared, who works on Sanity's developer experience team, compares its answers with the same OpenAI model without that context. He reports better matches for specific mechanics and recent games in the demonstration.
The setup starts with a Sanity project and a boardGame schema. Mechanics and categories become queryable arrays. An ingestion script combines BoardGameGeek's hot list with selected top-rated games, fetches details through its XML API, and imports 58 records in this example. Those records include ratings, complexity weight, player counts and play time. The script needs a project ID, a Sanity write token and a BoardGameGeek API bearer token.
After installing @sanity/agent-context, the tutorial deploys Studio to sanity.studio. Jared says a hosted Studio is required before the MCP URL works from a script. A context document scopes access to board game records through a GROQ filter. The Vercel AI SDK CLI connects over HTTP with a viewer read token and loads the endpoint's tools.
Example queries combine worker placement with deck building, request Wingspan's rating and complexity, and seek a short cooperative family game. These are demonstrations of querying imported records, rather than a general accuracy benchmark. The CLI uses a cloud-hosted Sanity backend and OpenAI; the tutorial does not demonstrate how to run models locally.