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

# List Tools

> Get a list of all available commerce tools

## Request

```bash theme={null}
GET /v1/tools
Authorization: Bearer YOUR_API_KEY
```

### Query Parameters

<ParamField query="format" type="string" default="mcp">
  Response format: `mcp`, `openai`, or `grok`
</ParamField>

<ParamField query="category" type="string">
  Filter by category: `products`, `cart`, `orders`
</ParamField>

***

## Response

<ResponseField name="success" type="boolean">
  Whether the request succeeded
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="tools" type="array">
      List of available tools

      <Expandable title="tool">
        <ResponseField name="name" type="string">
          Tool name (e.g., `search_products`)
        </ResponseField>

        <ResponseField name="description" type="string">
          Human-readable description
        </ResponseField>

        <ResponseField name="inputSchema" type="object">
          JSON Schema for tool parameters
        </ResponseField>

        <ResponseField name="category" type="string">
          Tool category: `products`, `cart`, `orders`
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="count" type="number">
      Total number of tools
    </ResponseField>
  </Expandable>
</ResponseField>

***

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl https://gateway.betterdata.io/v1/tools \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```typescript TypeScript theme={null}
  const response = await client.tools.list();

  console.log(response.data.tools);
  ```

  ```python Python theme={null}
  response = client.tools.list()

  print(response.data.tools)
  ```
</CodeGroup>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "tools": [
        {
          "name": "search_products",
          "description": "Search for products by query",
          "inputSchema": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string",
                "description": "Search query"
              },
              "limit": {
                "type": "number",
                "description": "Maximum number of results",
                "default": 10
              }
            },
            "required": ["query"]
          },
          "category": "products"
        },
        {
          "name": "get_product_details",
          "description": "Get detailed information about a product",
          "inputSchema": {
            "type": "object",
            "properties": {
              "productId": {
                "type": "string",
                "description": "Product ID"
              }
            },
            "required": ["productId"]
          },
          "category": "products"
        },
        {
          "name": "add_to_cart",
          "description": "Add an item to the shopping cart",
          "inputSchema": {
            "type": "object",
            "properties": {
              "productId": {
                "type": "string",
                "description": "Product ID"
              },
              "quantity": {
                "type": "number",
                "description": "Quantity to add",
                "default": 1
              }
            },
            "required": ["productId"]
          },
          "category": "cart"
        }
      ],
      "count": 3
    },
    "meta": {
      "requestId": "req_123abc",
      "timestamp": "2024-12-11T10:00:00Z"
    }
  }
  ```
</ResponseExample>

***

## Tool Categories

### Products

* `search_products` - Search for products
* `get_product_details` - Get product details
* `check_inventory` - Check stock levels
* `get_recommendations` - Get product recommendations

### Cart

* `add_to_cart` - Add item to cart
* `remove_from_cart` - Remove item from cart
* `get_cart` - Get current cart
* `clear_cart` - Clear all items

### Orders

* `create_order` - Create new order
* `get_order` - Get order details
* `list_orders` - List user's orders
* `cancel_order` - Cancel an order

***

## Format Conversion

### MCP Format (Claude)

```bash theme={null}
GET /v1/tools?format=mcp
```

Returns tools in Anthropic's MCP format for Claude Desktop.

### OpenAI Format (ChatGPT)

```bash theme={null}
GET /v1/tools?format=openai
```

Returns tools in OpenAI Function Calling format for ChatGPT.

### Grok Format (X/Twitter)

```bash theme={null}
GET /v1/tools?format=grok
```

Returns tools in Grok's function calling format.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Execute Tool" icon="play" href="/api-reference/gateway/execute-tool">
    Execute a tool with parameters
  </Card>

  <Card title="Chat Completion" icon="comment" href="/api-reference/gateway/chat-completion">
    Multi-turn conversation with automatic tool calling
  </Card>
</CardGroup>
