---
title: "Updates a custom agent tool"
method: PUT
path: "/agents/custom_tools/{tool_id}"
tags: ["Agents"]
---

# Updates a custom agent tool

`PUT /agents/custom_tools/{tool_id}`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/agents/custom_tools/{tool_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/agents/custom_tools/:tool_id/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates a custom agent tool given a tool id belonging to the user.
Two request body forms are accepted:
  - multipart/form-data — required to upload a `file`; also accepted for
    metadata-only updates (just send `tool_args`). This is the default
    content type the generated SDK clients use.
  - application/json — legacy metadata-only body (`{ "tool_args": ... }`)
    retained for backward compatibility with clients written before
    file upload was supported. JSON bodies cannot carry a file upload.

## Path parameters

- `tool_id` string, required

## Request body

- UpdateCustomAgentToolRequest
  - `tool_args` object, required: The new arguments for the custom agent tool

## Response `200`

Successful operation

- object
  - `agent_custom_tool_id` string: The ID of the updated custom agent tool

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `404`: Not found
- `500`: Internal server error
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
