Tools
Creating a “tool” for your API
This guide explains step by step how to create a JSON-formatted tool so our AI system can properly call your API. You don’t need to know TypeScript: just follow the indicated structure and fill in the fields with your information.
1. What is a “tool”?
A tool is a simple JSON file that describes:
- The URL of your API
- The HTTP method to use
- The headers to include
- The parameters that go directly in the URL (pathParameters)
- The parameters that appear after the “?” in the URL (queryParameters)
- An optional body to send additional data (bodyParameters)
Our AI system reads this to know how to call your API, which values to pass, in what format, etc…
2. General structure of the tool
Regarding the general structure, there are several parts: some are presented in a graphical interface, and others must be specified in JSON. Below is the main structure expected on the graphical part:
- URL
Indicate the full URL of your endpoint (with parameters in the path if applicable, e.g., /id
).
- Methods
The HTTP method to use: "GET", "POST", "PUT", "DELETE", or "PATCH".
- Headers
A list of objects describing each header to send, each header must contain:
- The header’s name (e.g., "Authorization")
- The header’s value (e.g., "Bearer 1234abcd")
- secret: “true” if the value must remain confidential (to avoid displaying it in plain text), “false” otherwise
The remaining parts (pathParameters, queryParameters, body) must be defined in JSON !
3. Path parameters (pathParameters)
Path parameters are found directly in the URL.
Example
For each path parameter, you indicate in the JSON input:
- parameterName: The exact name expected in the URL (e.g., userId).
- description: What is the purpose of this parameter ?
- parameterType: "string", "number", or "boolean".
- enumOptions: A list of allowed options (if you want to limit values; otherwise, you can leave an empty array []).
Important: The path parameter must appear in braces in the URL, and the same name must appear in parameterName. They must match exactly.
Example
If the URL is:
The JSON would include:
4. Query parameters (queryParameters)
Query parameters appear after a ? in the URL, for example:
For each query parameter, use this structure :
- parameterName: The exact name expected in the URL (e.g., userId).
- description: What is the purpose of this parameter ?
- parameterType: "string", "number", or "boolean".
- enumOptions: A list of allowed options (if you want to limit values; otherwise, you can leave an empty array []).
- required : “true” or “false” (to indicate whether it’s mandatory).
Example
5. Body parameters (bodyParameters)
If you make POST, PUT, or PATCH calls, you can send a request body.
The body definition must always be a root-level object with the following structure:
5.1. Properties inside the body
Each property in the body describes:
- type: "String", "Number", "Boolean", "Object", or "Array".
- description: What is the purpose of this field?
- required: Is it mandatory?
- (Optional) enumOptions: List of allowed values, if needed.
Example
Example with nested objects and arrays
6. Complete example
Imagine you want to create a tool for sending a POST request to:
with:
- A path parameter userId
- An optional query parameter forceUpdate
- A body describing the address (street, city, postalCode)
You could write:
7. Summary
-
URL: Your API URL (with /parameterName if you use path parameters).
-
Methods: The HTTP method (GET, POST, etc.).
-
Headers: A list of headers with their values (secret if necessary).
-
pathParameters: Describe each parameter in the URL and in the JSON.
-
queryParameters: Describe each query parameter (?param=value) in the JSON.
-
bodyParameters: Describe the structure of the data sent in the body (always an object at the root) in the JSON.
With this tutorial, you have all the elements you need to define your tool. This will allow our AI system to understand exactly how to call your API and what information to send. Happy coding!