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:
| Tool | Arguments | Does |
|---|---|---|
volley-describe-diagram | page | Returns the diagram as Markdown, with every payload |
volley-read-diagram-source | page | Returns the source text |
volley-replace-diagram-source | source | Replaces the whole diagram and returns any problems, or a summary when there are none |
volley-check-diagram | none | Returns problems with line and column, or ok |
volley-select-message | message | Selects a message by number and returns its payloads. 0 clears the selection. |
volley-save-diagram | none | Saves the diagram to the signed-in account and returns its short link |
volley-fill-diagram-source | value | Types 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:
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 clearsFor example, with Playwright:
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.