register-peer-agent
Register an external agent on another platform as a peer agent connection, so that a process flow can hand a
whole goal to it. It returns the connection_id that an interop_agent node, the external agent node, points
at: it goes on the node as registration_id.
Test the endpoint first with handshake-peer-agent. Registration runs
its own handshake as well, and records what the external agent says about itself;
list-peer-agents shows it afterwards.
The name must be unique within the project. It is the only thing telling two connections apart anywhere a
person looks, so a second connection with the same name is refused and nothing is created.
The secret is supplied once, here, and no tool returns it afterwards, in any form. There is no rotate
operation: to change the credential, delete the connection with
delete-peer-agent and register it again.
This registers the console's "single peer agent" connection type, which takes a whole goal. The console's other type, a tool catalog, is a different concept and is not created here.
What it is called on each surface
The wire name is register-peer-agent everywhere: it is what the Wexa MCP server advertises, the REST path is
POST /v1/register-peer-agent, and each SDK exposes it under its own language's naming convention.
| Surface | Name |
|---|---|
| Wexa MCP server | register-peer-agent |
| REST API | POST /v1/register-peer-agent |
| TypeScript SDK | fabric.registerPeerAgent() |
| Python SDK | fabric.register_peer_agent() |
Arguments
3 of the 7 arguments are required. Omitting a required one is refused before the tool runs, at the validation stage, so it costs nothing and changes nothing.
| Argument | Type | Required | Notes |
|---|---|---|---|
name | string | Required | Unique within this project. |
endpoint | string | Required | The external agent's full http:// or https:// URL. |
protocol | string | Required | mcp or a2a — which protocol the external agent speaks. |
secret | string | Optional | The bearer token or API key. Supplied once, here; no tool ever returns it. |
description | string | Optional | A description of the connection. |
platform | string | Optional | A label for which platform this agent runs on. |
auth | string | Optional | key, oauth or mtls. Default key. |
A protocol other than mcp or a2a is refused, and the refusal names both.
project_id, projectID, organization_id and executed_by are not arguments you pass: the
platform binds all four from the credential you authenticated with, and both SDKs refuse them
before the request leaves your process — see
server-bound arguments.
What it returns
| Field | What it is |
|---|---|
connection_id | The id an interop_agent node takes as registration_id. |
name, protocol, endpoint | What you registered. |
state | Draft when registered, Active once a call to the external agent has gone through. |
The secret is not in the result.
The three surfaces wrap this differently, and code written against one will not read another correctly — see return shape.
An example of what register-peer-agent returns. Every field shown is one the tool really sets: the
shape was checked against a live call to a running deployment. The ids, endpoints and
names are illustrative, so swap them for your own.
{
"content": [
{
"type": "text",
"text": "{\"lifecycle_id\":\"qlc_000064\",\"result\":{\"connection_id\":\"6ab3e1c07f2d9a4b1c5e8d20\",\"name\":\"invoice-reconciler\",\"protocol\":\"a2a\",\"endpoint\":\"https://agents.example.com/a2a/invoice-reconciler\",\"state\":\"Draft\"}}"
}
],
"isError": false
}Keeping the lifecycle_id is what lets you ask later why a call was allowed, refused or held.
Calling it
The same call on all four surfaces. Pick a tab once and every code block in the documentation follows it.
A value in angle brackets is one only you can supply, and the platform refuses a literal <...>.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "register-peer-agent",
"arguments": {
"name": "invoice-reconciler",
"endpoint": "https://agents.example.com/a2a/invoice-reconciler",
"protocol": "a2a",
"secret": "<the external agent's token>"
}
}
}Errors
Both SDKs raise the same typed errors, chosen from the gateway's own error string first and its
HTTP status second. register-peer-agent checks the fabric:orchestrate.write grant, and reaches the seven classes every
tool reaches — listed under the common set. These are the ones specific to it:
| Error | Status | Raised when |
|---|---|---|
ValidationError | 422 | name or endpoint is missing, or protocol is not mcp or a2a. |
UpstreamError | 502 | A peer agent connection with this name already exists in the project. The message says so and that nothing was created. Retrying will not help: pick a different name. |
ApprovalRequired | 202 | A policy held this call for a person to approve. The error carries the approval id; see below. |
ConfigurationError | 5xx | register-peer-agent is not available to you. Retrying will not help. |
Governance
Every call to register-peer-agent runs through the same ten-stage lifecycle as every other tool: the
credential is resolved to a scope, the fabric:orchestrate.write grant is checked, quota is drawn down, the arguments are
validated, policy rules are evaluated, the call is executed, the result is shaped and redacted, and an audit
record is written. The lifecycle_id in the response is the handle to that record.
register-peer-agent is marked consequential, which means it changes something rather than only reading. Two things
follow. It is audited in full rather than lightly, and a policy rule may hold it for human approval — in which
case the call returns 202 and an ApprovalRequired error carrying the approval id, and the SDKs can wait for
the decision and resume rather than making you call again.
See also
handshake-peer-agent to test the endpoint first,
list-peer-agents,
delete-peer-agent,
create-process-flow for the external agent node,
the tool index, errors,
and which identifier goes where.