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

# Execute a tool by name with parameters.

> Tool execution result

### Path parameters

<ParamField path="tenant_id" type="string" required>
  Tenant identifier
</ParamField>

### Request body

`ExecuteToolRequest`

<ParamField body="confirm" type="boolean" />

<ParamField body="params" type="object" required />

<ParamField body="reason" type="string" />

<ParamField body="sessionId" type="string" />

<ParamField body="tool" type="string" required />

### Response

`object`

<ResponseField name="tool" type="string" required>
  Name of the tool that was executed
</ResponseField>

<ResponseField name="result" type="object" required>
  Tool-specific result payload
</ResponseField>

<ResponseField name="sessionId" type="string">
  Agent session id when one was supplied; null otherwise
</ResponseField>

### Status codes

| Code  | Meaning                                  |
| ----- | ---------------------------------------- |
| `200` | Tool execution result                    |
| `401` | Unauthorized                             |
| `404` | Tool not found                           |
| `428` | Confirmation required for mutating tools |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.sync.stateset.com/v1/tenants/{tenant_id}/agent/execute' \
    --header 'x-stateset-api-key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "confirm": true,
    "params": {},
    "reason": "Two-person tent, green — replacement for damaged pole set.",
    "sessionId": "string",
    "tool": "string"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "tool": "string",
    "result": {},
    "sessionId": "string"
  }
  ```
</ResponseExample>
