Docs / Agents and API

In-page agent tools

Tools for agents and scripts that drive the editor in a browser.

On this page

When the Volley editor is open in a browser, agents and scripts can work with the diagram on the page directly. Nothing here needs an account or a key, and nothing is metered.

WebMCP tools

In browsers that support WebMCP, the editor registers tools that a browser agent can call:

ToolArgumentsDoes
volley-describe-diagrampageReturns the diagram as Markdown, with every payload
volley-read-diagram-sourcepageReturns the source text
volley-replace-diagram-sourcesourceReplaces the whole diagram and returns any problems, or a summary when there are none
volley-check-diagramnoneReturns problems with line and column, or ok
volley-select-messagemessageSelects a message by number and returns its payloads. 0 clears the selection.
volley-save-diagramnoneSaves the diagram to the signed-in account and returns its short link
volley-fill-diagram-sourcevalueTypes into the editor as a person would

Long results are split into pages of about 1,400 characters. Pass page to read the next one; the last line of each page says which page it is.

The page also has general tools for reading the page as an agent sees it: volley-list-page-regions, volley-read-region and volley-set-page-view.

window.volley

For test scripts and browser automation, the editor exposes the same operations on window.volley:

js
window.volley.getSource();          // the source text
window.volley.setSource(text);      // replace the diagram; returns problems or a summary
window.volley.check();              // "ok", or one problem per line
window.volley.describe();           // the whole diagram as Markdown
window.volley.diagram();            // the parsed diagram as an object
window.volley.select(3);            // select message 3; 0 or null clears

For example, with Playwright:

js
await page.goto("https://volley.sh/edit#new");
const result = await page.evaluate((source) => window.volley.setSource(source), diagramText);
if (!result.startsWith("ok")) throw new Error(result);

The agent view

Press Alt+Shift+A (Option+Shift+A on Mac), or choose Agent view in the gear menu, to see the page as an agent reads it: the source in a plain text box and the diagram as text, with every message and payload. It is a quick way to check that an agent will see what you expect. Press Esc to go back.

Suggested

↑↓ moveEnter openEsc close

Keyboard shortcuts

/ or Ctrl+KSearch the docs
↑ ↓Move through search results
EnterOpen the highlighted result
Ctrl+EnterOpen the result in a new tab
[ and ]Previous and next page
g then hDocs home
tBack to the top of the page
?Show these shortcuts
EscClose a dialog

The editor has its own shortcuts. See Keyboard shortcuts.