Skip to content

About

A social work licensure readiness diagnostic your AI agent can operate, built on WebMCP. The agent drives, you answer, the page updates live.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Study With Your Agent

Live: swtpa-agent-study.vercel.app

A social work licensure readiness diagnostic built for two different agents, on WebMCP.

Built for the OpenAI WebMCP Challenge (September 2026) by Social Work Test Prep Academy.

Open it in any browser and the Agent Console drives every tool by hand. Open it in a browser that exposes document.modelContext or navigator.modelContext and your own agent drives them instead.

Two agents, one page

Most "agent-ready" demos imagine one visitor. This page is built for two, and they want opposite things.

1. The coach: readiness is a KPI, not a score

An agent that studies with someone over weeks does not need a chat transcript. It needs a number it can move. get_readiness returns readiness out of 100 with a band, and the page remembers it locally between visits, so the second time an agent asks it does not get a bare number, it gets a direction:

Readiness is 68 out of 100, which is the "Developing" band. Up 27 from 41 on Aug 25.

That single delta changes what the agent is. It is no longer a quiz reader. It is something managing a metric on the learner's behalf: measure, find the weak areas, prescribe, come back, re-measure. get_study_prescription closes that loop from the other side, because the agent already knows the exam date from the person's calendar. The page never had that context. The agent carries it in, and the page turns it into a dated, week by week plan.

Exam prep is also the rare task an agent genuinely cannot do for you. It can pick what you study, track where you are weak, and keep you honest, but it cannot answer the question on your behalf, because the point is what ends up in your head. The agent drives, the human decides, and both need to see the same screen.

2. The shopper: an agent that can test the claim before repeating it

The next referral surface is an agent asking "which ASWB prep should I get?" on someone's behalf. Today it answers from marketing copy it scraped. Here it can do better: it can actually run the diagnostic, see how the questions are written, call explain_reasoning to inspect the teaching quality, and then call get_program_facts for structured pricing and trial terms it does not have to infer.

get_program_facts is written for that reader specifically. It contains no usage statistics, no pass rates, and no testimonials, because none of those are verifiable from this page. It does contain the inconvenient facts, like the free trial not running on iOS. An agent that quotes us should be able to quote us accurately, including where we are weaker than a competitor.

Tools published

Registered on load via registerTool(...) on whichever modelContext the host exposes. Every tool returns MCP style { content: [{ type: 'text', text }] } prose the agent can speak, plus structuredContent it can reason over. Every tool also writes to shared app state, so the page reacts while the agent works.

Tool Input What it does
start_diagnostic examLevel: LBSW | LMSW | LCSW Begins a diagnostic, renders the first question
get_current_question none Returns the current stem plus options A to D. Never returns the key
submit_answer choice: A to D Scores the answer, returns the explanation and progress
get_readiness none Score out of 100, band, interpretation, and the delta since last visit. Works with no diagnostic running
get_weak_areas none Content areas ranked weakest first with accuracy in each
build_study_plan none Ordered plan, weakest area first, with an action and time estimate per step
get_study_prescription examDate, optional weakAreas Dated week by week plan counting back from the exam date the agent supplies
explain_reasoning questionId, answer Why the keyed option holds, and why the chosen distractor was tempting
quiz_me category One extra practice item in a content area, outside the diagnostic
submit_practice_answer choice Grades the practice item on screen
get_program_facts none Structured, first-party product facts for an agent comparing options

Running it

npm install
npm run dev        # http://localhost:5173
npm run typecheck  # tsc against tsconfig.app.json
npm run build      # typecheck + production build

No API keys, no backend, no account. It runs entirely in the browser.

With an agent

WebMCP is experimental, and hosts disagree on where the API lives. ChatGPT's in-app browser is described with document.modelContext; Chrome 146 Canary and up expose navigator.modelContext. The page resolves document.modelContext ?? navigator.modelContext, so either host works, and the badge in the header names the one it found ("Agent connected via navigator.modelContext"). The tools register, and you can talk to your agent: "start an LCSW diagnostic and walk me through it."

Without an agent (demo mode)

If no WebMCP host is present the app does not degrade into a broken page. The Agent Console panel fires the exact same tool functions by hand, through the same callTool path an agent uses. Every tool is reachable, the whole loop works, and the tool response text the agent would have read is printed underneath.

To see the returning-visitor behavior: run a diagnostic, call get_readiness, reload the page, then call get_readiness again. There is a "forget me and reload" button in the console to reset it.

The data is sample data, permanently, by design

This app runs on MockProvider and it always will. That is a decision, not a placeholder.

The six questions here, their explanations, and every per-option rationale were written from scratch for this open-source demo. They are not from the Social Work Test Prep Academy question bank, which is private and stays private. Readiness scores produced here are illustrative and are not a prediction of exam performance.

Wiring a public, open-source client to the production question bank would mean either shipping a credential in a public repo or standing up an unauthenticated question endpoint. Neither is worth doing to win a hackathon. What is worth demonstrating is the interface: what an agent can do with a study product when the product publishes tools instead of pages. Original sample data demonstrates that completely.

The data layer still sits behind a DiagnosticProvider interface, because that is how the same tool surface gets adopted by the real app later. It is a seam for the production codebase, not an unfinished swap in this one.

How it is put together

src/
  data/
    sampleQuestions.ts        Six original questions, keys, and per-option rationales
    programFacts.ts           First-party product facts for a shopping agent
  diagnostic/
    types.ts                  Domain types shared by tools, provider and UI
    DiagnosticProvider.ts     The interface. The only seam to a data source
    MockProvider.ts           Scoring, readiness, weak areas, plan, prescription
    index.ts                  Provider selection
  webmcp/
    types.ts                  Minimal WebMCP typings, since there is no @types package
    tools.ts                  The eleven tool definitions and their bodies
    register.ts               Registration, host detection, graceful absence
  state/
    store.ts                  Tiny external store the tools write and the UI reads
    persistence.ts            localStorage, so readiness has a history to compare against
  components/                 Question card, readiness ring, weak areas, plans, console

Two rules keep this honest. Tools and UI never reach for a data source directly, they go through DiagnosticProvider. And every read or write to localStorage is wrapped, because storage can be blocked, full, or hold data from an older version, and none of those may break a page someone is mid-question on.

License

MIT. See LICENSE.

About

A social work licensure readiness diagnostic your AI agent can operate, built on WebMCP. The agent drives, you answer, the page updates live.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages