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

# Tolstoy Agent

> Tools that send a message to the Tolstoy Agent, read its chat and stop its turn.

## run\_agent

> [!NOTE]
>
> On Claude, this tool is listed only for workspaces allowed to generate media. See [Claude](https://developers.gotolstoy.com/agents/connect.md#claude).

Sends a message to the Tolstoy Agent, the workspace's agent, and returns once the turn has started; the answer is read from the chat. The agent answers in text: it plans content and campaigns, writes briefs and scripts, researches the brand and its market, and reads store analytics, in one chat that continues across turns. A turn spends credits.

> **Input schema**
>
> ```json theme={null}
> {
>   "type": "object",
>   "properties": {
>     "message": {
>       "type": "string",
>       "minLength": 1,
>       "description": "The user's request, in their own words."
>     },
>     "chatId": {
>       "type": "string",
>       "minLength": 1,
>       "description": "The chat to continue. Without it, a new chat starts."
>     }
>   },
>   "required": [
>     "message"
>   ],
>   "additionalProperties": false,
>   "$schema": "http://json-schema.org/draft-07/schema#"
> }
> ```

## get\_agent\_chat

Reads a Tolstoy Agent chat: whether its turn is waiting, running or done, the agent's answer for a finished turn, the images and videos that turn made, and the credits it used. It only reads.

> **Input schema**
>
> ```json theme={null}
> {
>   "type": "object",
>   "properties": {
>     "chatId": {
>       "type": "string",
>       "minLength": 1,
>       "description": "The chat to read."
>     },
>     "messageId": {
>       "type": "string",
>       "minLength": 1,
>       "description": "The message whose turn to read. Without it, the latest turn is read."
>     },
>     "wait": {
>       "type": "boolean",
>       "description": "Wait up to about 50 seconds for a running turn to end. Defaults to false."
>     }
>   },
>   "required": [
>     "chatId"
>   ],
>   "additionalProperties": false,
>   "$schema": "http://json-schema.org/draft-07/schema#"
> }
> ```

## stop\_agent

Stops the running turn of a Tolstoy Agent chat, the way Stop does in the Tolstoy platform. A generation already sent to a provider still finishes and is billed.

> **Input schema**
>
> ```json theme={null}
> {
>   "type": "object",
>   "properties": {
>     "chatId": {
>       "type": "string",
>       "minLength": 1,
>       "description": "The chat whose running turn to stop."
>     }
>   },
>   "required": [
>     "chatId"
>   ],
>   "additionalProperties": false,
>   "$schema": "http://json-schema.org/draft-07/schema#"
> }
> ```


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