List Tools
curl --request GET \
--url https://api.example.com/v1/toolsimport requests
url = "https://api.example.com/v1/tools"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/tools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/tools"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/tools")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"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"
}
}
Gateway Endpoints
List Tools
Get a list of all available commerce tools
GET
/
v1
/
tools
List Tools
curl --request GET \
--url https://api.example.com/v1/toolsimport requests
url = "https://api.example.com/v1/tools"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/tools', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/tools",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/tools"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/tools")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tools")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"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"
}
}
Request
GET /v1/tools
Authorization: Bearer YOUR_API_KEY
Query Parameters
string
default:"mcp"
Response format:
mcp, openai, or grokstring
Filter by category:
products, cart, ordersResponse
boolean
Whether the request succeeded
object
Example
curl https://gateway.betterdata.io/v1/tools \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await client.tools.list();
console.log(response.data.tools);
response = client.tools.list()
print(response.data.tools)
{
"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"
}
}
Tool Categories
Products
search_products- Search for productsget_product_details- Get product detailscheck_inventory- Check stock levelsget_recommendations- Get product recommendations
Cart
add_to_cart- Add item to cartremove_from_cart- Remove item from cartget_cart- Get current cartclear_cart- Clear all items
Orders
create_order- Create new orderget_order- Get order detailslist_orders- List user’s orderscancel_order- Cancel an order
Format Conversion
MCP Format (Claude)
GET /v1/tools?format=mcp
OpenAI Format (ChatGPT)
GET /v1/tools?format=openai
Grok Format (X/Twitter)
GET /v1/tools?format=grok
Next Steps
Execute Tool
Execute a tool with parameters
Chat Completion
Multi-turn conversation with automatic tool calling
⌘I