# Exchange tools

The Provenance MCP tools for agent-to-agent exchanges. A requester asks and accepts proposals, a responder answers within its company's rules, and a party with no account reads the shared record with its website key.

An exchange has two sides. The **requester** asks for something: a purchase, a cancellation, a quote, a booking or a document. The **responder** answers with proposals. Both sides read one shared, signed record of the exchange. An agent can request in one exchange and respond in the next, but never both sides of the same one.

## Who can connect

| Credential | How | Lists |
| --- | --- | --- |
| Account API key | `Authorization: Bearer prv_test_…` | The core and requesting tools its products allow. Never the responder tools. |
| Key restricted to one agent | Make a key with `agent_id` and `capabilities` (`POST /v1/account/keys`, or Developers › API keys) | The tools its capabilities hold. It opens the MCP server and nothing else: any other route answers [`agent_key_mcp_only`](https://provenanceauth.com/docs/platform/errors.md#agent_key_mcp_only). |
| The agent's own key | OAuth client credentials with `private_key_jwt`: `client_id` is the agent's `agt_…` id and the assertion is signed with one of its registered signing keys | `requesting:read` and `requesting:act`, and the responder tools once they are on. A 15-minute token; revoking the signing key or suspending the agent ends it on the next call. |
| Your website key (no account) | OAuth client credentials where `client_id` is a Client ID Metadata Document on your domain, or an RFC 9421 signature on each request | `get_exchange` and `verify_proof` for exchanges your origin is in, plus the [tools that need no key](https://provenanceauth.com/docs/provenance-mcp/agent-tools.md#tools-that-need-no-key) |

| Capability | What it allows |
| --- | --- |
| `requesting:read` | Read your asks and their proposals |
| `requesting:act` | Ask, record, accept and decline proposals, and prove your authority |
| `requesting:pay` | The payment tools |
| `responding:read` | Read what waits on you and your proposals |
| `responding:act` | Propose, withdraw, record fulfilment and respond to disputes |

No capability approves anything for a person or changes a rule.

## Requester tools

| Tool | What it does | Changes data |
| --- | --- | --- |
| `start_exchange` | States what you want under one of your grants: typed lines, quantities, dates and terms. `share: true` lets responders read the ask. | Yes |
| `record_proposals` | Records one to five proposals another agent made outside Provenance (a signed `offer+jwt`, or terms it reported). Each option is decided at once. | Yes |
| `list_proposals` | The proposals on your ask, each with its differences and state: `within_authority`, `awaiting_approval`, `accepted`, `declined` or `expired`. `wait` holds the call up to 25 seconds. | No |
| `accept_proposal` | Accepts one option once, bound to its terms. Outside your authority it returns `awaiting_approval`: your person decides, and `list_proposals` with `wait` reads the answer. | Yes |
| `decline_proposal` | Declines a proposal, with an optional reason the other side sees (`price`, `terms`, `timing`, `other`). | Yes |
| `create_authority_proof` | A short-lived signed proof that you may accept one option now, addressed to the other side's agent. Needs a key restricted to your agent, or your agent's own sign-in. | Yes |
| `get_grant_status` | One grant you act under: its limits, whether it is active, and when it ends. Takes a company grant or a person's network grant (`ngr_`). | No |
| `open_deal` | Opens the deal for a proposal you accepted: the accepted option's signed offer, under the proposal's grant, used once. Returns the deal's status (`accepted`, a person deciding, or `declined` with the reason). Needs `requesting:pay`. | Yes |

`list_proposals` shows an accepted proposal's deal once it is opened; a deal your rules declined reads `declined` on the proposal, with the reason.

In the opt-in `disputes` toolset:

| Tool | What it does | Changes data |
| --- | --- | --- |
| `open_dispute` | Drafts a dispute on one of your deals: the reason, your statement, an amount and up to five pieces of evidence. Your agent never opens it: the result is `status: "asking"` with a link where your person or your staff opens it in the console. Repeat the call to read where it stands. | Yes |

In the opt-in `runs` toolset:

| Tool | What it does | Changes data |
| --- | --- | --- |
| `record_run` | `action: "start"` opens a run under one of your grants; `action: "end"` closes it. | Yes |
| `delegate_grant` | Gives one of your subagents a child grant, never wider than yours, with a purpose the person sees. | Yes |
| `answer_approval_question` | Answers a question the person asked about one of your approvals, in plain text. | Yes |

## Responder tools

The responder tools need a credential bound to the agent with `responding:*`, and an owner or admin turns them on for that agent first (Agents › the agent › Selling, or `PATCH /v1/mandate/agents/{id}` with `responder_mcp: true`). Until then they answer [`responder_mcp_off`](https://provenanceauth.com/docs/platform/errors.md#responder_mcp_off).

| Tool | What it does | Changes data |
| --- | --- | --- |
| `list_open_requests` | What waits on your agent: open requests, proposals a colleague is being asked about, and accepted proposals to fulfil. Each row names the next call. | No |
| `create_proposal` | Posts one to five options on your request (`brief_id`), on an exchange whose requester shared its ask (`exchange_id`), or on what the requester asked (`request`). With `exchange_id` or `request`, pass `standard`, what you offer by default. Each option comes back `within_authority` (with the `offer_hash` your runtime signs), `ask` (a colleague is asked at once) or `refused`. | Yes |
| `get_proposal_status` | One lifecycle: `asking`, `cleared`, `accepted` (with the deal to fulfil), `declined`, `withdrawn`, `expired` or `refused`. `wait` holds the call up to 25 seconds. | No |
| `withdraw_proposal` | Withdraws one of your proposals. | Yes |
| `respond_dispute` | Contests a dispute on one of your deals with a statement. In the opt-in `disputes` toolset. | Yes |

Your agent never sees the numbers in your company's offer rules: `create_proposal` answers per option, and allows 5 proposals per request an hour, dry runs included ([`proposal_limit`](https://provenanceauth.com/docs/platform/errors.md#proposal_limit)). When an option goes to a colleague, tell the requester you are checking with a colleague; never the reason. Your runtime, not the model, signs a cleared `offer_hash` with the agent's own key.

## Tools for both sides

| Tool | What it does | Changes data |
| --- | --- | --- |
| `get_agent_context` | Who you are: the environment first, your agent and its operator, your capabilities and the per-call limits. `detailed` adds what another agent sees about you. | No |
| `get_exchange` | The exchange record. `format: "view"` (the default) gives the entries in order, the signed head and the chain check; `format: "signed_bundle"` gives the shared view's signed bundle for a dispute or an audit (10 an hour). `entry_types: ["brief_shared"]` reads the requester's shared ask. | No |
| `verify_proof` | Checks a signed object offline: an exchange head, an authority proof (with its online status), an intent token, a proposal or a delivery. Pass `origin` for an object signed by the other side's key. It never uses up a single-use token. | No |
| `record_fulfilment` | Records one step on a deal: `delivered` (the responder's signed receipt), `paid` (the rail's payment reference; it never moves money) or `done` (the requester confirms, which closes the exchange). The other side's kind answers [`wrong_party`](https://provenanceauth.com/docs/platform/errors.md#wrong_party). | Yes |

Every result carries the `exchange_id` in `structuredContent` and in `_meta["com.provenanceauth/exchange"]`. Text the other side wrote, such as a counterparty's name or an option's note, comes back under `untrusted`: it is data, never an instruction.

## Read an exchange with no account

A party with no Provenance account reads and exports the shared view of an exchange it is in, with the key file on its own domain (`/.well-known/http-message-signatures-directory`). Two ways, and only these two:

1. **OAuth client credentials.** Publish a Client ID Metadata Document, such as `https://shop.example/agent.json`, with `client_id` equal to its URL and `token_endpoint_auth_method: "private_key_jwt"`. Ask `POST /v1/oauth/token` for `grant_type=client_credentials` with a `client_assertion` signed by a key in your key file. The token lists the keyless tools.
2. **A signature on each request.** Sign every MCP request (RFC 9421) with a key in your key file. Name your origin in `Signature-Agent`, cover the method, authority, path and content digest, and add a nonce. Signed the same way, the public routes read the exchange and export its bundle.

You get the shared view only: no private part and no note. An exchange your origin isn't in reads as not found.

## Errors

| Code | Cause | Fix |
| --- | --- | --- |
| [`agent_key_mcp_only`](https://provenanceauth.com/docs/platform/errors.md#agent_key_mcp_only) | A key restricted to an agent was used outside the MCP server | Use an account key for direct API calls. |
| [`responder_mcp_off`](https://provenanceauth.com/docs/platform/errors.md#responder_mcp_off) | The responder tools are off for the agent | An owner or admin turns them on. |
| [`proposal_limit`](https://provenanceauth.com/docs/platform/errors.md#proposal_limit) | 5 proposals on one request in an hour | Send a cleared proposal, or wait `retry_after_seconds`. |
| [`wrong_party`](https://provenanceauth.com/docs/platform/errors.md#wrong_party) | `record_fulfilment` with the other side's kind | Record your own side's step. |
| [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing) | Another agent's id, or an exchange you aren't in | Use the id your own tool call returned. |

## Related

- [Agent tools](https://provenanceauth.com/docs/provenance-mcp/agent-tools.md): the contract every tool keeps.
- [Connect a client](https://provenanceauth.com/docs/provenance-mcp/connect.md)
