[data-reveal]{opacity:1!important;transform:none!important}
AntelopeJS DMS
DocumentationRequests a built block sends

Requests a built block sends

Which routes a block an agent builds through the MCP builder tools may send the person's writes to, which links it may hold, and how the tools refuse the rest.

A block runs in the person's browser with the person's session, so a form an agent wrote that posts to /api/builder/database/connections/check would hand that route a URL the person never typed. builder_add_block, builder_compose_page and builder_configure_block refuse with invalid_config, and write nothing, when an option sends a request outside the page's own data API:

  • a submitUrl, or a secret field's rotateUrl;
  • a fetchUrl whose fetchUrlMethod is not GET;
  • the url of an api or exportJob action target, such as a TableView custom row action.

Each of these must be a DataAPI endpoint of one of the project's resources (/api/<resource>/new, /edit, /delete, /archive, /restore, /export/start and the reads). A route under the page's slug is refused, even a query the page declares: a query answers reads, and an agent names its endpoint, so it could name another controller's write route. The path holds plain segments: a {{token}}, a dot segment, a % escape or another origin is refused, so a record id goes in the query string (/api/orders/edit?id={{params.id}}).

A link is refused when it names a scheme other than http, https, mailto or tel, read as the browser reads it, so javascript: cannot hide behind a tab or a leading space, or when it writes out no scheme and a {{token}} comes before its first /, ? or #, since the dashboard fills a token before it follows the link and an empty token would join a scheme back together. A token after a written-out scheme is fine (mailto:{{row.email}}); a link that is a single token ({{row.invoiceUrl}}) is refused, since its row would pick the scheme. This holds for a to link and for the url of a page or external action target.

builder_configure_block judges the options the builder would merge the patch into, found by the builder's own resolution of the block path, since a patch merges key by key: a patch of fetchUrlMethod: "POST" alone turns the block's fetchUrl into a write, and is refused unless that URL is allowed. A URL the patch leaves as it was is not judged, so a block whose author pointed it elsewhere can still be edited. When the builder would not edit the block, or a URL option the patch would turn into a request is written in code, a patch that writes any of these options is refused, with the pointer /path.

A patch is written only if the page is still as it was judged: of two patches judged against the same page, the second answers stale, so two halves sent at once cannot together turn a load into a write. Read the page again and send it again.

builder_compose_page judges each block as the builder writes it, with its query's route in the option query.into names (fetchUrl by default). That route is the page's, never a write target, so a query written into submitUrl, or into a fetchUrl sent with POST, is refused.

builder_add_block refuses a block name that is not an identifier, as builder_compose_page does (pointer /name): a child named a/b would read, in a block path, as the child b of a.

mockup_apply_to_page judges the blocks it writes the same way, each on the options it changes from the live block, and answers invalid with the draft pointer, such as /blocks/0/config/fetchUrl, writing nothing.

The issue's pointer names the option, such as /config/submitUrl. A request to any other route is the person's to add.