MCP tools

For AI agents: this page is Markdown at https://squiggle.sh/docs/reference/mcp.md. Every docs page is listed at https://squiggle.sh/llms.txt, and all of them are one file at https://squiggle.sh/llms-full.txt.

Every one of the ninety tools the Squiggle MCP server gives your agent, grouped by job. Your agent reads each tool's full description from the server; this page is for you, to know what it can reach for.

To connect the server, see Connect your agent. For how the tools fit together, see What your agent can do.

Start here

ToolWhat it does
statusWhat is connected, which app, which tools work right now and why not. Needs no licence.
targetList the running apps and switch to one.
briefsProblems the app has already found (crashes, friction, slowdowns), each with a recording, a cause and a source line.
drive_mode_briefingThe working rules for driving an app, for an agent to read before it starts.
perf_mode_briefingThe working rules for performance work.

Look at the screen

ToolWhat it does
describeWhat is on screen, controls first, each with a short reference to act on. Can return only what changed since the last look.
findWhether a selector matches one control, several or none, before acting.
querySearch the live component graph.
inspectOne component’s live props, hooks, state and context.
rendersWhich components re-render most, how fast and why: memo misses, render loops, what started each burst, and providers that recreate their value.
assertCheck that something is true now: visible, a route, a value.
wait_forWait until something becomes true.
screenshotAn image of the screen, when nothing else will do.
legibilityScore how easily an agent can drive the screen, and name the lines to fix, ranked by the points each edit adds.
report_cardAfter building a feature: tour the screens the change touched, run the flows that cover them, and check their budgets, findings, legibility and interface. Green, or the line to fix for each row. Pass changedFiles (the files you changed; omit to use the branch’s git diff), full: true to check every screen, tour: false to skip the tour, and live: true to run the flows against your real backend instead of the stubs recorded on each flow’s last green run. A touched screen no saved flow covers fails the card. Takes minutes, since it runs real flows. Failing rows come first, at most 60; the full card is saved to the file the result names.

Act on the app

ToolWhat it does
tapTap a control by reference or selector.
hoverMove the pointer onto a control, or off it, so its hover card or outline shows. Runs the app’s hover handlers; no cursor moves.
input_textType into a field.
swipeSwipe; the direction is where the finger goes.
scrollScroll; the direction is where the content goes.
scroll_until_visibleScroll until a control appears, in one call.
backGo back a screen.
launch_appLaunch or relaunch the app.
run_flowRun a flow file and return its result.
batchRun several of these tools in one call.

tap, hover, input_text, swipe, scroll, scroll_until_visible, back, batch and tune return what changed on screen once it settles: the new route, what appeared, and whether motion stopped. Pass observe: false for a bare acknowledgement when the agent is about to act again straight away.

Run a journey as a program

ToolWhat it does
intent_schemaThe full grammar of an intent program.
run_intentStart a program that drives a whole journey.
intent_waitWait for a running program to finish or stop.
resume_intentAnswer a decision a program stopped for.
approve_actionApprove one step the deny rail blocked. Your client asks you first.
steerAdd a hint a running program must follow.
intent_stopStop a running program.
intent_continuePick up a program that died, without asking the model again for decisions already made.
branchFrom one point in a program (at), try several continuations (alternatives, each with its own goal) and rank which reached its goal. Blocks until every branch has run. With fromSlot: true, the prefix runs once and a save slot taken there is loaded before each branch instead of a relaunch and replay; the prefix must end on a known screen (a waitFor or assert on a route), and a branch whose slot won’t load replays instead. order: margin runs the alternative whose first tap most surely matches a control on the branch screen first; firstWin: true stops at the first branch that reaches its goal and lists the rest in notRun.
agent_configRead the deny rail, the learned popup handlers and the run limits.
agent_statsModel turns per journey, escalation and replay rates, and how often saved answers were reused.

See Intent programs and Safety and approvals.

Remember the app

ToolWhat it does
library_listThe saved flows the agent can replay. An entry whose last run healed a selector carries healMargin, its thinnest heal: a low value is the flow most likely to break next.
library_saveSave a program that worked as a reusable flow.
routeThe shortest known path to a screen.
predictWhat a tap has led to before, without touching the app. With horizon (1–10), where the app has usually been that many taps on, each screen with the share of recorded paths that end there, and the share that ran out of recorded exits.
what_ifWhat a flow did before under a condition, from the race, twin and fuzz runs already recorded; it never touches the app. Pass flow (by name), condition (repeat, back, slow, error, empty, truncated or offline) and, for repeat and back, step. Says “unknown” when nothing was recorded under that condition.
interfaceEach screen’s controls and where they lead. save: <name> stores a copy; against: <name> compares the live app with a stored copy and lists the saved flows the change puts at risk. A flow is at risk when a control it taps is gone or leads somewhere else, or when, on a changed screen, a selector that matched a control there would now match nothing, be refused by self-healing, or win by under 20 points (the reason gives the margin before and after). The first squiggle up stores one named first.
affected_by_diffGiven changed files, which screens and saved flows they touch, before the app is built.
crawlExplore the app and map its screens.
invariantsStanding checks the app should keep passing: flows with goals, inferred rules, performance limits.
fixtureSave and restore a named starting point, such as a cart with three items: action is list, capture or restore, with name. Restoring puts back the screen as well as the data. It uses the same slots as squiggle save and squiggle load, so a slot saved in one loads in the other. Reports unsupported when the app registered no data source.
deterministic_sessionPin the network, animations, clock and locale so two runs can be compared.
tuneWith no name, lists the values the app declared tunable with defineTunable, and their current values. With name and value, sets one within its declared range and step; with name and reset: true, puts back its default. The app refuses an undeclared name or an out-of-range value, and a set value is dropped on reload. An app built before tunables answers unsupported.
bisect_stateFind which app state makes a flow fail. Takes a flow (name or yaml) and two save slots: green, which the flow passes from, and failing, which it fails from. It loads green with some of failing’s store values put in, runs the flow, and narrows to the smallest set of fields that still fails. Returns those fields, every field that differed, the number of loads it took, and a brief with the line that writes each field and the components that read it. A slot name the deny list matches is refused. When it finds the fields, it leaves the app on the green slot.

Record and look at frames

ToolWhat it does
record_startStart recording the app.
record_stopStop and save the recording.
replay_recordingReplay a recording with no app, and optionally check a flow against it.
diff_runsCompare two recordings: renders, screens, requests and timings. With journey (an intent program’s name: its runs that passed) or cohort (names, paths or patterns like login-*) instead of b, judge one recording against many: every number outside the range of all of them, and whether any took its route.
filmstripA contact sheet of a video’s frames, or per-frame brightness to catch a one-frame flash. Needs ffmpeg.

Explain and share

ToolWhat it does
explainWhy something happened, traced through the recorded causes.
verify_citationsCheck every evidence link in a report still points at what it claims.
publish_evidenceAttach a recording, screenshot or filmstrip to the pull request. Needs prEvidence turned on.
perf_narrative_contextA session’s findings with their evidence resolved, for writing up what happened.

Performance data

ToolWhat it does
perf_insightsA session’s findings, worst first.
propose_fixTurn a finding into an edit plan. With tuning (an id, or latest), plan the edit a squiggle flow --tune or --matrix --repair chose instead: each tunable’s default line before and after, with what was measured. Never edits a file.
perf_reportA summary of a session.
perf_topThe newest value of each metric.
perf_sqlRun a read-only SQL query.
probe_readRun a short read-only script against the data and return only its result.
probe_read_capabilitiesWhat probe_read scripts can call.
perf_saved_query_listThe saved queries.
perf_saved_query_saveSave a query.
perf_saved_query_runRun a saved query.
perf_snapshotSave a session as a baseline.
perf_diffCompare a session with a baseline.
perf_profileTake a CPU profile of the JS thread.
perf_heapTake a heap snapshot.
perf_heapdiffWhat grew between two heap snapshots.
perf_crashesFind and store native crash reports.
perf_symbolicateTurn stack frames back into source lines.
perf_export_traceExport a session for Perfetto or chrome://tracing.
perf_gcClean up old performance data now.

See Performance.

Product data

ToolWhat it does
product_overviewThe headline numbers.
product_screensVisits, time and exit rate per screen.
product_usageHow often each named action ran, or its adoption.
product_affinityActions people use together.
product_frictionRage taps, dead zones and confusion across sessions. withState: true adds the app state at each moment.
product_heatmapWhere people touched each screen, and how they scrolled. include: ["intents"] adds what drags meant: dismiss, refresh, reorder or scrub, per screen, each with its evidence.
product_stateWhat the app held on each screen, from its state samples: with no path, the feature paths; with path, that feature’s values per screen. Instead of that, coverage: true lists states real sessions reached that no flow or save slot did, each with a proposed slot (never saved by the tool); drift: true compares two releases (latest against the one before, or pick them with from and to); perf: true reads performance findings against the state in force when each happened.
product_funnelsThe saved funnels.
product_funnel_evalEvaluate a funnel.
product_retentionRetention by cohort.
product_releasesEach release and when it first appeared.
product_usersIdentified users, with an at-risk flag.
product_sessionsEach session with its screens and actions.

product_screens, product_friction, product_funnel_eval and product_retention also take whereState, such as zustand:useCart.items#len >= 3, to compare the sessions that reached a state with the rest. See Product analytics.