Skip to content
Docs

Action definitions

Describe each action Arc may perform: the request it sends, its parameters and what it records.

01What a definition is

An action definition maps an action key, such as refund:create, to exactly one HTTPS request through one connection. When an agent asks for that action and Arc allows it, Arc builds the request from the definition and the agent’s parameters, sends it, and records the result.

The agent never writes the request itself. It can only supply the typed parameters the definition allows, so it cannot reach any other endpoint or change any other field. Each organisation has at most one active definition per action key. Administrators define them in Systems & Actions → Actions.

02Fields

FieldMeaning
actionThe action key agents ask for. Letters, digits and _ . : -, up to 64 characters. Fixed once defined.
descriptionUp to 500 characters. Agents read it: over MCP it is the tool’s description.
connection_idThe system to send the request to. It must be active.
resource_typeThe type of resource the agent must name, e.g. payment. Grants scope resources by type.
methodGET, POST, PUT, PATCH or DELETE.
pathAppended to the connection’s base address, e.g. /customers/{{ resource.id }}. No query string here.
queryUp to 20 query parameters, as templates.
headersUp to 10 headers, as templates. Arc-controlled headers such as Authorization and Content-Type are not allowed.
bodyA JSON template for POST, PUT and PATCH, up to 8,000 bytes.
parametersUp to 30 typed parameters the agent supplies (below).
uses_amountThe action carries an amount and currency. Every request must then include both, and grants can limit them.
captureUp to 20 response fields to record as evidence, as dotted paths such as id or data.status. Nothing else from the response is kept.
idempotency_headerIf set, Arc sends its execution id in this header, so the system can recognise a repeat.

03Parameters

Each parameter has a name (lowercase letters, digits and underscores), a type of string, integer, number or boolean, and optionally a description. Parameters are required unless "required": false. Strings can also set max_length (up to 2,000) and an enum of allowed values.

Arc validates every request against them before deciding anything: unknown parameters, wrong types, values outside the enum or too long, and control characters are all rejected with 422 INVALID_PARAMETERS. Booleans are never accepted as numbers.

04Placeholders

Templates use {{ name }}. Arc fills them from the request:

PlaceholderValue
params.<name>A parameter the agent supplied.
resource.type, resource.idThe resource the agent named.
purposeThe purpose the agent stated.
principal.kind, principal.idOn whose behalf: organisation, employee or customer, and its id.
arc.request_idThe agent’s request id.
amountThe amount as a decimal string, e.g. 42.50. Needs uses_amount.
amount_minorThe amount in minor units, e.g. 4250 for 42.50 USD, 42 for 42 JPY, 42500 for 42.500 KWD. Needs uses_amount.
currencyThe ISO 4217 code, e.g. USD. Needs uses_amount.

How values are inserted

  • A body value that is exactly one placeholder keeps its JSON type: "{{ amount_minor }}" becomes the number 4250.
  • Inside longer text, values are inserted as text. In the path they are URL-encoded.
  • An optional parameter the agent leaves out removes the whole value, list item, query parameter or header it fills. That is why optional parameters may only fill a whole value, never the path or part of a text.
  • Arc checks every placeholder when the definition is saved, and refuses unknown ones.

05Example

Definition
{  "action": "refund:create",  "description": "Refund part or all of a customer's payment.",  "connection_id": "<payments system>",  "resource_type": "payment",  "method": "POST",  "path": "/v1/refunds",  "parameters": [    { "name": "reason", "type": "string", "enum": ["duplicate", "requested_by_customer"] },    { "name": "note", "type": "string", "required": false, "max_length": 500 }  ],  "uses_amount": true,  "body": {    "payment": "{{ resource.id }}",    "amount": "{{ amount_minor }}",    "currency": "{{ currency }}",    "reason": "{{ params.reason }}",    "metadata": { "note": "{{ params.note }}", "arc_request": "{{ arc.request_id }}" }  },  "capture": ["id", "status"],  "idempotency_header": "Idempotency-Key"}

Example

An agent asks to refund 42.50 USD on payment pay_3141 with the reason duplicate. If its grant allows it, Arc sends:

HTTP
POST https://payments.example.com/v1/refundsAuthorization: Bearer <held by Arc>Idempotency-Key: <Arc execution id>Content-Type: application/json{  "payment": "pay_3141",  "amount": 4250,  "currency": "USD",  "reason": "duplicate",  "metadata": { "arc_request": "refund-ticket-77" }}

Example

The optional note was not supplied, so it was left out. Arc records the id and status the payments system returns.

06Versions

  • Amending a definition creates a new version, with a reason for the change. Earlier versions are kept for good.
  • Each decision records the exact definition version it was made under.
  • If the definition changes between the decision and the moment Arc would act, for example while an action waits for approval, Arc refuses to act with DEFINITION_CHANGED. A person approved one request; Arc will not send a different one.
  • Revoking a definition is permanent. The action key can then be defined again.
See Grants and principals to give an agent authority over the action.