a9script

Docs / Endpoints: webhooks, APIs, MCP, apps

Shapes: parameter structures

A parameter structure names the shape of a JSON value once, in your environment, and is referenced by name wherever a shape is said: what a configured function takes, what a script takes and answers, what an operation’s tool schema declares. It is optional — a function or a script that declares nothing is exactly what it was — and it is the one thing on this platform that describes data rather than doing something with it.

How a shape is written

A structure is a list of fields. Each field has a name, a kind, whether it is required, and a description. The kinds are the JSON ones; a nested object is another structure, referenced by name — a shape cannot be written inline — and a list is a flag on the field rather than an item type, so a list of lists cannot be written at all. The escape hatch is a field of kind object, which accepts anything.

That discipline is deliberate: it keeps a structure small enough to read and a schema generated from it small enough for a client to use. Parameter structures is the page that walks the whole model: every kind, nesting by name, and the two places a shape is never checked.

Where a shape is checked

  • At an API endpointAnswering a caller — after the caller’s credential and before a run starts: a call that could never work costs no run, and a stranger cannot read the shape out of a refusal.
  • At an MCP endpoint, the same check on a tool call’s arguments; the schema an assistant is offered is generated from the structure, which An endpoint an assistant can call shows in full.
  • On a function’s Test, before the call leaves.
  • Never inside a script. Inside the platform the language is JS; a script calling a function is not checked against the structure.
  • At a webhook endpoint, it reports. Nobody holds a sender to your shape, so a mismatch becomes one warning line in the run’s own log and the run happens.

The check never converts a value — "5" for a number field is refused — and never echoes one back, because what arrives may be a credential posted to the wrong place. An undeclared field passes: a structure is what you hand to something, not a closed contract. null reads as absent.

In the editor

Declare a structure on a script and the editor knows the body’s shape: the fields complete and hover, before anything is activated. A reference the editor cannot resolve degrades to any rather than to a guess.

Renames and cycles

A reference is a name, resolved nowhere: create and reference in either order, and a promotion carries the reference as it is. Two things are judged for you: a structure that references itself through others is refused on Activate, naming what closed the cycle; and a rename that leaves other entities naming the old name is reported as a warning — the one mistake nothing else would catch.

Written for this site. What it says is held true by packages/shared/test/structure-check.test.ts, apps/runtime/test/gateway-input-structure.test.ts, apps/ui/e2e/parameter-structures.spec.ts in the product's own repository. Found a problem on this page? Write to the address in the footer.