> ## 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.

# Update a tool; activated:false retires it

> The tool

### Path parameters

<ParamField path="id" type="string (uuid)" required>
  The tool id.
</ParamField>

### Request body

`UpdateFunction`

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

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

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

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

<ParamField body="activated" type="boolean">
  Set false to retire the tool.
</ParamField>

<ParamField body="parameters" type="object[]" />

<ParamField body="headers" type="object" />

<ParamField body="timeout" type="integer" />

### Response

`Function`

<ResponseField name="object" type="string" />

<ResponseField name="id" type="string" />

<ResponseField name="name" type="string,null" />

<ResponseField name="endpoint" type="string,null" />

<ResponseField name="method" type="string,null" />

<ResponseField name="description" type="string,null" />

<ResponseField name="activated" type="boolean" />

<ResponseField name="agent_id" type="string,null" />

### Status codes

| Code  | Meaning                                                  |
| ----- | -------------------------------------------------------- |
| `200` | The tool                                                 |
| `400` | Invalid request. `issues` names the offending field(s).  |
| `401` | Missing, invalid, or expired API key.                    |
| `403` | The key lacks a required scope.                          |
| `404` | Not found, or not in the organization that owns the key. |
| `429` | Rate limit exceeded.                                     |

### Access

|                |                        |
| -------------- | ---------------------- |
| Required scope | `agents:write`         |
| Rate limit     | 30 requests per minute |

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url 'https://response.stateset.com/api/v1/functions/{id}' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "function_name": "string",
    "endpoint": "string",
    "method": "string",
    "description": "string",
    "activated": true,
    "parameters": [
      {
        "name": "string",
        "type": "string",
        "description": "string",
        "required": true
      }
    ],
    "headers": {},
    "timeout": 1
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "object": "string",
    "id": "string",
    "name": null,
    "endpoint": null,
    "method": null,
    "description": null,
    "activated": true,
    "agent_id": null
  }
  ```
</ResponseExample>
