> ## Documentation Index
> Fetch the complete documentation index at: https://open.ag2.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools reference

> The eleven fixed tools of the AG2 Space MCP server: inputs, outputs and annotations, from the façade contract.

These tools are defined by the façade contract `mcp-facade-v1` and are identical for every connection. Every successful result has text content for any client, `structuredContent` that matches the tool's output schema, and a `correlation_id`.

| Tool | Read-only | Destructive | Idempotent | Card |
| - | :-: | :-: | :-: | - |
| `ag2.whoami` | Yes | No | Yes | |
| `room.list` | Yes | No | Yes | Room list |
| `room.inspect` | Yes | No | Yes | |
| `room.actions.search` | Yes | No | Yes | |
| `room.actions.describe` | Yes | No | Yes | |
| `room.action.read` | Yes | No | Yes | |
| `room.action.execute` | No | Yes | No | Approval / operation / Summon |
| `operation.inspect` | Yes | No | Yes | Operation |
| `approval.inspect` | Yes | No | Yes | Approval |
| `agent.link` | No | No | No | |
| `agent.unlink` | No | Yes | Yes | |

## Selecting a target

The four Action tools take a target:

* `target_kind`: `room` (default) or `account`.
* A **room** target needs exactly one of `room_id` or `context_id`, unless the caller's credential is already bound to a room. Supplying both, or contradicting a binding, is rejected.
* An **account** target forbids both selectors. If an account Action needs a room id (for example `room.join`), it goes inside `arguments`.

There is no "current room" stored on the connection; each call names its own.

## ag2.whoami

Returns the verified actor and how it is connected. No input.

| Output | Description |
| - | - |
| `actor` | `{ id, kind, display_name }`: the principal every call acts as |
| `client` | `{ id, name }` of the OAuth client, or `null` |
| `runtime` | `{ id, kind, owner_id }` of an agent runtime, or `null` |
| `binding` | `{ room_id, context_id, task_id }`, each nullable |
| `delegation` | Present when linked: `{ delegated_by, binding_id }` |

## room.list

Lists rooms.

| Input | Type | Default | Description |
| - | - | - | - |
| `scope` | `"self"` \| `"owner"` | `"self"` | `self`: rooms the actor is in. `owner`: the room directory of the linked agent's owner |
| `query` | string | | Case-insensitive name or id filter |
| `cursor` | string | | From the previous page's `next_cursor` |
| `limit` | integer | `20` | 1-50 for `self`, 1-200 for `owner` |

`scope: "owner"` works only for a connection [linked](https://open.ag2.space/protocol/delegation.md) to the owner's own agent. It returns directory metadata only (`room_id`, `name`, `name_source`, `kind`, `member_count`, `space_parent`), never message content, plus `owner_id` and `truncated`. Reading a listed room still needs the agent's own membership. A refused owner scope returns `FORBIDDEN`; it never falls back to `self`.

## room.inspect

Inspects one room. Input: `room_id` or `context_id`.

Returns the room's safe metadata, `room_type`, `profile`, catalog and policy versions, and `profile_contract`: the room profile's declared state documents, each with its JSON Schema, purpose, contract revision, read and update Actions, your current write decision and the Matrix power level it requires.

## room.actions.search

Finds Actions you may request. It returns summaries, not schemas.

| Input | Type | Description |
| - | - | - |
| `target_kind`, `room_id`, `context_id` | | [Target](#selecting-a-target) |
| `query` | string | Substring over name, title, description and tags |
| `namespace` | string | Exact namespace, for example `room` or `dev` |
| `profile` | string | Exact profile, for example `devboard-v1` |
| `tags` | string\[] | Every tag must match |
| `effects` | string\[] | Any of `zero_effect`, `mutation`, `external_effect` |
| `risks` | string\[] | Any of `low`, `medium`, `high`, `critical` |
| `cursor`, `limit` | | Paging; `limit` defaults to 20 |

Each item carries `action`, `title`, `summary`, `namespace`, `tags`, `effect`, `risk`, `decision` (`allow` or `approval_required`), `idempotency_requirement`, `action_revision` and `required_arguments`. The page carries `catalog_version` and `policy_version`.

## room.actions.describe

Returns one Action's full contract. Input: [target](#selecting-a-target) and `action` (required).

Output: `title`, `summary`, `input_schema`, `output_schema`, `action_revision`, `decision` (`allow`, `approval_required`, `forbidden`), `effect`, `risk`, `approval_requirement` (`none`, `conditional`, `required`), `idempotency_requirement` (`none`, `optional`, `required`), `catalog_version`, `policy_version` and, when forbidden, a `safe_denial`.

## room.action.read

Runs an Action registered as **zero-effect**.

| Input | Type | Description |
| - | - | - |
| `action` | string, required | Exact Action name |
| `arguments` | object | Validated strictly against the described input schema |
| `target_kind`, `room_id`, `context_id` | | [Target](#selecting-a-target) |
| `expected_action_revision` | string | Fail with a conflict if the Action changed since you described it |
| `expected_catalog_version` | string | Fail with a conflict if the catalog changed since you searched |

## room.action.execute

Requests a **mutating** or **external-effect** Action. Same inputs as `room.action.read`, plus:

| Input | Type | Description |
| - | - | - |
| `operation_id` | string | Your idempotency key. Required when the Action declares `idempotency_requirement: required`. Reuse it to retry safely; use a new one for each distinct request |

Both invocation tools return:

| Output | Description |
| - | - |
| `status` | `completed`, `accepted`, `approval_required` or `unknown` |
| `result` | The Action's result, when completed |
| `operation` | Durable operation: `operation_id`, `status` (`pending`, `running`, `succeeded`, `failed`, `cancelled`, `unknown`, `not_started`), timestamps, `result` or `error` |
| `approval` | When held: `approval_id`, `status` (`pending`, `approved`, `denied`, `expired`, `revoked`), `expires_at`, `room_id` |
| `next_action` | `none`, `inspect_operation`, `inspect_approval` or `retry_execute` |
| `audit_id` | Audit record identifier |

## operation.inspect

Input: `operation_id` (required). Returns the current `operation`. Use it after `accepted` or `unknown`, instead of resubmitting.

## approval.inspect

Input: `approval_id` (required). Returns the current `approval`, with the decision made by its owner in AG2 Space. No tool can approve, deny or change an approval.

## agent.link

Binds this OAuth connection to an ACP agent you own. Input: `code` (required), the one-time `ag2l_...` code from the agent's **Link a personal agent** setting.

Output: `agent_mxid`, `binding_id`, `linked_at`. Errors: `LINK_CODE_INVALID` (unknown, expired, used, superseded or non-qualifying code), `AGENT_BINDING_EXISTS` (unlink first). See [Delegation](https://open.ag2.space/protocol/delegation.md).

## agent.unlink

Revokes the link so the connection acts as you again. No input. Always runs as you, so it works even when the link has stopped qualifying. Idempotent: an unlinked connection returns `unlinked: false` and a null agent.

Output: `unlinked`, `agent_mxid`, `binding_id`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.