new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

explore / Web & frontend / mozg

tRPC

Answer questions about tRPC as documented today: defining routers and procedures, input and output validation, context and middleware, error handling and formatting, the React Query and TanStack integrations, server adapters for each framework, subscriptions, and end-to-end type inference.

1,011 notes · updated 2026-08-12 · trained 79%

since last sitting: +32 newly passed — this brain is learning · the verified changelog →

use this brain
# sign in to get a token
$ claude mcp add --transport http mozg \
https://mozg.sh/mcp --header "Authorization: Bearer …"
> use mozg/trpc — …
Sign in — get this command with your token in it

New here? Sign in and this exact command appears with your token already inside — copy, paste into your terminal, done.

Or just add it

Sign in and add it, and every agent you have connected can read it — nothing to download, and it stays current as the author updates it.

Sign in to add it

Ask it things like

answers 30/35 on its latest exam · anti-bluff 2/5
What method adds middleware to a procedure, and what does middleware receive and return?Context & Middleware
What is the base procedure type you get from initTRPC, and how do you create queries and mutations from it?Defining Routers & Procedures
How do you export the tRPC router type to the client for end-to-end type safety?End-to-End Type Inference
How do you attach a validator to a procedure's input, and what is the method name?Input & Output Validation
What is the minimal setup to create a tRPC client with vanilla TypeScript (no framework)?Client Setup
What design pattern does tRPC use for building procedures—can you chain methods on the same procedure object?Defining Routers & Procedures
How do you nest multiple routers together into a single router?Defining Routers & Procedures
What is the TRPCError class, and what parameters does it require?Error Handling & Formatting

What it can answer

35 coverage checks
79%
Answers 32 of the exam's 40 questionsIt answers 32 questions, 32 more than last time, out of an exam that grew by 40.Nothing it used to answer has stopped working.
Defining Routers & Procedures4 / 4
Input & Output Validation4 / 4
Context & Middleware3 / 4
End-to-End Type Inference3 / 3
Error Handling & Formatting3 / 3
Next.js Integration3 / 4
React Query Integration3 / 4
Server Adapters3 / 4
Client Setup2 / 2
Subscriptions2 / 3
exam badge — share this score →

Attacks survived

re-run weekly · 2026-08-10
gate-battery12/12 known hostile payloads caught by the ingest gate
injection-corpusevery active note scanned — no steering language
secret-corpusevery active note scanned — no keys or credentials

heuristic scans against known attack classes — measured and dated, not a promise of unpoisonability

Inside

  • E2E type safety with tRPC · end-to-end type inference
  • tRPC response handler location in Next.js · server adapters/next-app-dir
  • pnpm dev command starts Next.js and WebSocket server · setup/nextjs-app-router
  • Next.js Prisma WebSockets starter example setup · setup/nextjs-app-router
  • WebSocket and subscription support in Next.js starter · subscriptions
  • tRPC routers location in Next.js starter · defining routers and procedures
  • next-prisma-starter Render deployment · setup/nextjs-app-router
  • next-prisma-starter example project setup · setup/nextjs-app-router
  • next-prisma-starter key file paths · setup/nextjs-app-router
  • next-prisma-starter pnpm commands · setup/nextjs-app-router
  • next-prisma-starter requirements · setup/nextjs-app-router
  • TodoMVC example setup command · setup/nextjs-app-router
  • TodoMVC dx command · setup/nextjs-app-router
  • TodoMVC example stack · setup/nextjs-app-router

Licence

CC BY-NC-SA 4.0

Use it, copy it, build on it, with credit. Selling it is not allowed.