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

# Create Tool

Create a new custom tool that agents can use during calls.

### Headers

<ParamField header="X-API-Key" type="string" required>
  Your API key for authentication.
</ParamField>

<ParamField header="X-Organization-Id" type="string" required>
  The organization ID.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`.
</ParamField>

### Permissions

* `tools:create` (admin, agent\_manager)

### Request Body

<ParamField body="config" type="object" required>
  Tool configuration object.

  <Expandable title="config properties">
    <ParamField body="tool_name" type="string" required>
      Name of the tool. Must be unique within your organization. Pattern: `^[a-zA-Z0-9_]+$` (1-50 characters).
    </ParamField>

    <ParamField body="tool_description" type="string" required>
      Natural language description of what the tool does. The LLM uses this to decide when to call the tool (1-500 characters).
    </ParamField>

    <ParamField body="webhook_url" type="string" required>
      The API endpoint URL that Butter AI will call (1-500 characters).
    </ParamField>

    <ParamField body="http_method" type="string" default="POST">
      HTTP method: `GET`, `POST`, `PUT`, `PATCH`, or `DELETE`.
    </ParamField>

    <ParamField body="headers" type="object">
      Key-value pairs of HTTP headers to include in the request (e.g., `{"Authorization": "Bearer ..."}`).
    </ParamField>

    <ParamField body="parameters" type="array">
      List of parameters the tool accepts.

      <Expandable title="ToolParameter properties">
        <ParamField body="parameter_name" type="string" required>
          The name of the parameter. Pattern: `^[a-zA-Z0-9_]+$` (1-50 characters).
        </ParamField>

        <ParamField body="parameter_type" type="string" required>
          The data type: `string`, `integer`, `number`, `boolean`, `null`, `object`, or `array`.
        </ParamField>

        <ParamField body="parameter_description" type="string" required>
          Description used by the LLM to extract this value from the conversation (1-200 characters).
        </ParamField>

        <ParamField body="parameter_required" type="boolean" default="true">
          Whether this parameter is mandatory for the tool call.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="timeout_seconds" type="integer" default="30">
      Maximum time to wait for your API to respond (1-60 seconds).
    </ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable success message.
</ResponseField>

<ResponseField name="data" type="object">
  The created tool object.
</ResponseField>

<RequestExample>
  ```json Request theme={null}
  {
    "config": {
      "tool_name": "GetOrderStatus",
      "tool_description": "Retrieves the status of a customer order using their order ID",
      "webhook_url": "https://api.shop.com/orders/status",
      "http_method": "POST",
      "headers": {
        "Authorization": "Bearer token123"
      },
      "parameters": [
        {
          "parameter_name": "order_id",
          "parameter_type": "string",
          "parameter_description": "The unique order identifier",
          "parameter_required": true
        }
      ],
      "timeout_seconds": 30
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Tool created successfully",
    "data": {
      "tool_id": "tool_a1b2c3d4e5f6",
      "tool_name": "GetOrderStatus",
      "tool_description": "Retrieves the status of a customer order using their order ID",
      "webhook_url": "https://api.shop.com/orders/status",
      "http_method": "POST",
      "headers": {
        "Authorization": "Bearer token123"
      },
      "parameters": [
        {
          "parameter_name": "order_id",
          "parameter_type": "string",
          "parameter_description": "The unique order identifier",
          "parameter_required": true
        }
      ],
      "timeout_seconds": 30,
      "client_id": "org_abc123",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  }
  ```
</ResponseExample>
