# Agent tools

> What a connected agent can do in Orvind. The plain-text copy of this page holds the full tool reference.

Page for people: https://orvind.com/docs/agents/tools/
This text: https://orvind.com/docs/agents/tools.md

A [connected](https://orvind.com/docs/agents/connect/) agent works with Orvind through a set of tools. You do not call them yourself: you ask in plain words and the agent picks the tool.

## What you can ask for

| Ask | The agent |
|---|---|
| "List my Orvind campaigns." | Lists the campaigns you can open |
| "Show the playables of `<campaign>`." | Lists the versions and their playables |
| "In `<campaign>`, make the first level easier." | Sends the request to the Playground and shows you the plan |
| "Go ahead." | Starts the change. This uses credits. |
| "Is it done?" | Reports progress, then gives you a link to play the draft |
| "Save it as a new version called Easy start." | Saves the draft as a version |
| "Stop it." | Cancels the running edit |

The agent asks you before it starts a change, because starting one spends your team's [credits](https://orvind.com/docs/team/credits/).

## The full reference

The tool names, inputs and replies are written for agents. They are in the plain-text copy of this page: [`/docs/agents/tools.md`](https://orvind.com/docs/agents/tools.md).

## Tool reference

These are the tools an agent gets after [connecting](https://orvind.com/docs/agents/connect/) to `https://mcp.orvind.com`. Every call runs as the signed-in user, with the same access, daily edit limit and credits as in the app.

## Look around (read-only)

| Tool | Inputs | Returns |
|---|---|---|
| `list_campaigns` | `search?`, `offset?` | Campaigns the account can open, newest first |
| `get_campaign` | `campaign_id` | The campaign, its versions (base game, then v1, v2…), playable counts, and whether the Playground is open on each |
| `list_playables` | `version_id`, `offset?` | The playables of a version: name, tag, build state |
| `get_playground` | `version_id` or `playable_id` | Whether you can edit and save, and the sessions, latest first |
| `get_conversation` | `version_id`, `session_id`, `before?` | A session's messages and what came of each |
| `get_preview` | `version_id`, and `run_id` or `playable_id` | Links valid for 1 hour: `play_url` (plays in a browser, no sign-in), `editor_url` (opens the app), `download_url` (one HTML file) |

A `version_id` is a campaign's id or the id of one of its saved versions.

## Talk and change

| Tool | Inputs | Does | Spends credits |
|---|---|---|---|
| `send_message` | `version_id` or `playable_id`, `session_id?`, `message`, `edit_level?`, `request_key?` | Asks a question or requests a change. Changes nothing. Leave out `session_id` to start a new session. | No |
| `start_change` | `turn_id`, `answers?`, `note?` | Starts the planned edit. Returns a `run_id`. | **Yes** |
| `just_answer` | `version_id`, `turn_id` | Answers in words instead of making the planned change | No |
| `get_run` | `version_id`, `run_id`, `wait_seconds?` | The edit's status: stage, latest progress line, ready, failed with reason, or cancelled. Also save status. | No |
| `cancel_run` | `version_id`, `run_id` | Stops a waiting or running edit. What it used so far is charged. | No |
| `select_draft` | `version_id`, `session_id`, `run_id?` | Sets which draft the next message builds on. Leave out `run_id` for the original game. | No |
| `continue_session` | `session_id` | For a session that no longer accepts messages because the game was updated: opens a new session that keeps the chat | No |
| `save_version` | `version_id`, `run_id`, `name?`, `overwrite_this_version?` | Saves a draft as a new version. With `overwrite_this_version`, replaces a saved version's game and rebuilds its playables. | No |

### `send_message` replies

`send_message` can take up to about 2 minutes. Its reply has a kind:

| Kind | Meaning | Next step |
|---|---|---|
| `answer` | A reply in words | Show it to the user |
| `question_back` | The agent needs something clarified | Ask the user, then `send_message` again |
| `declined` | The request is outside what the Playground does | Tell the user |
| `change_proposed` | A plan, possibly with questions | Show the plan; on the user's yes call `start_change`, otherwise `just_answer` |
| `change_started` | An edit is already running | Follow it with `get_run` |

- `message`: 1 to 8,000 characters.
- `edit_level`: `light`, `standard` or `express`. See [Edit levels](https://orvind.com/docs/pages/playground/#edit-levels).
- `request_key`: any unique text. Sending the same key again does not create a second request, so a retry after a timeout is safe.

### `start_change` inputs

- `answers`: one option number per question in the plan. `0` is the suggested option.
- `note`: up to 2,000 characters, for anything to do differently.

Only the user who sent the message can start its change.

## Example: make a change

1. `list_campaigns` → find the campaign.
2. `get_campaign` → pick the version; check the Playground is open on it.
3. `send_message` with `version_id` and the request, for example "Make the first level easier to win".
4. The reply is `change_proposed`. Show the user the plan and its questions.
5. The user agrees → `start_change` with the `turn_id` and their `answers`.
6. `get_run` with `wait_seconds: 50`, repeated until the status is ready, failed or cancelled. Edits usually take a few minutes, sometimes up to 20.
7. Ready → `get_preview` with the `run_id`, and give the user the `play_url`.
8. Only if the user asks → `save_version`, then `get_run` until the save is done.

## What can go wrong

| Situation | What it means |
|---|---|
| The Playground is not open on a version | Orvind has not opened it for the campaign. The user contacts their Orvind team. |
| The daily edit limit is used up | New edits are available again within 24 hours. Questions still work. |
| The session has `accepts_messages: false` | The game was updated. Call `continue_session`. |
| An edit is already running in the session | Wait for it with `get_run`, or ask questions meanwhile. |
| The run failed | The game is unchanged. Tell the user the reason; retry only if they ask. |

The same rules as in the app apply. See [Playground](https://orvind.com/docs/pages/playground/).
