SWSpatial Workbench

Callable spatial runtime

Spatial analysis, in a small API.

Discover a tool, send GeoJSON state, and receive the next state plus an execution receipt. The API is stateless: your response becomes the next request.

Base URLhttps://workbench.dannymcvey.com
GeoJSON-nativeInputs and results stay portable.
InspectableEvery run returns timing and feature counts.
Honest spatial metadataWarnings surface CRS and geometry concerns.

First request

Generate five points

Call RandomPointsTool with a bounding box. Save the returned state to use as input for your next operation.

JavaScript
const response = await fetch('/api/run', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    tool: 'RandomPointsTool',
    params: { 'Points Count': 5, 'Inside Polygon': false },
    state: { bbox: [-118.5, 33.5, -118.2, 33.8] }
  })
});

const result = await response.json();
// result.state is ready for the next API call
GET

/api/run

Returns the live catalog of supported headless tools, their parameters, the API’s spatial assumptions, and an example request shape. This is the endpoint agents should call before choosing a tool.

200 JSON responseOpen raw response ↗
cURL
curl https://workbench.dannymcvey.com/api/run
POST

/api/run

Executes one headless tool against the state you provide. Use the returned state as the authoritative handoff for a chained workflow.

Request body

toolstring

The key returned by discovery, such as BufferTool.

paramsobject

Parameters for that tool. Names match the tool catalog exactly.

stateobject

Serialized spatial state. Use either layers or featureCollection.

cURL
curl -X POST https://workbench.dannymcvey.com/api/run \
  -H 'Content-Type: application/json' \
  -d '{
    "tool": "RandomPointsTool",
    "params": { "Points Count": 5, "Inside Polygon": false },
    "state": { "bbox": [-118.5, 33.5, -118.2, 33.8] }
  }'

State model

State is explicit and request-scoped.

The server does not save a session. For layer tools, send state.layers; for attribute tools, send state.featureCollection. Each layer needs a stable id and GeoJSON.

1. Sendstate + params
2. Runtool execution
3. Chainreturned state

Response contract

Know what happened, not just what returned.

Successful executions include status, output, the next state, spatial metadata, and an execution receipt.

200 · completed

Valid tool calls—including tool-level validation failures—return a consistent envelope. Check ok and status.

400 · malformed input

Invalid request shapes or invalid spatial state return structured validation details.

4xx · unsupported tool

Unknown or unsupported tool keys are rejected before execution.

Live catalog

Tools available now

Loading the current catalog…