Api Reference

List Tools

Edit this page

Request

1GET /v1/tools
2Authorization: Bearer YOUR_API_KEY

Query Parameters

· string

Response format: mcp, openai, or grok

· string

Filter by category: products, cart, orders


Response

success · boolean

Whether the request succeeded

data · object
properties
tools · array

List of available tools

tool
name · string

Tool name (e.g., search_products)

description · string

Human-readable description

inputSchema · object

JSON Schema for tool parameters

category · string

Tool category: products, cart, orders

count · number

Total number of tools


Example

1curl https://gateway.betterdata.io/v1/tools \
2 -H "Authorization: Bearer YOUR_API_KEY"
1const response = await client.tools.list();
2 
3console.log(response.data.tools);
1response = client.tools.list()
2 
3print(response.data.tools)

Example response

1{
2 "success": true,
3 "data": {
4 "tools": [
5 {
6 "name": "search_products",
7 "description": "Search for products by query",
8 "inputSchema": {
9 "type": "object",
10 "properties": {
11 "query": {
12 "type": "string",
13 "description": "Search query"
14 },
15 "limit": {
16 "type": "number",
17 "description": "Maximum number of results",
18 "default": 10
19 }
20 },
21 "required": ["query"]
22 },
23 "category": "products"
24 },
25 {
26 "name": "get_product_details",
27 "description": "Get detailed information about a product",
28 "inputSchema": {
29 "type": "object",
30 "properties": {
31 "productId": {
32 "type": "string",
33 "description": "Product ID"
34 }
35 },
36 "required": ["productId"]
37 },
38 "category": "products"
39 },
40 {
41 "name": "add_to_cart",
42 "description": "Add an item to the shopping cart",
43 "inputSchema": {
44 "type": "object",
45 "properties": {
46 "productId": {
47 "type": "string",
48 "description": "Product ID"
49 },
50 "quantity": {
51 "type": "number",
52 "description": "Quantity to add",
53 "default": 1
54 }
55 },
56 "required": ["productId"]
57 },
58 "category": "cart"
59 }
60 ],
61 "count": 3
62 },
63 "meta": {
64 "requestId": "req_123abc",
65 "timestamp": "2024-12-11T10:00:00Z"
66 }
67}

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)

1GET /v1/tools?format=mcp

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

OpenAI Format (ChatGPT)

1GET /v1/tools?format=openai

Returns tools in OpenAI Function Calling format for ChatGPT.

Grok Format (X/Twitter)

1GET /v1/tools?format=grok

Returns tools in Grok's function calling format.


Next Steps