Custom Tools
Creating Tools
Build your first custom tool step by step
1 min read
Documentation
Create custom tools to extend Billix with your own APIs and logic.
Creating a Tool
Go to Settings
Open Settings → Custom Tools.
Click Create Tool
Click "Create New Tool."
Configure Basic Info
- Name: Clear, descriptive name (e.g., "Get Weather")
- Description: What the tool does (helps AI know when to use it)
Choose Tool Type
Select how the tool works:
- API: Calls an HTTP endpoint
- Code: Executes JavaScript
- Composio: Uses integration action
Define Parameters
Specify inputs the tool accepts.
Configure Execution
Set up how the tool runs.
Test
Run test cases to verify.
Save
Save and start using.
API Tools
Call external REST APIs:
Name: Lookup Stock Price
Type: API
Method: GET
Endpoint: https://api.stocks.com/quote
Headers:
Authorization: Bearer {{API_KEY}}
Parameters:
symbol (string): Stock ticker symbolConfiguration
| Field | Description |
|---|---|
| Method | GET, POST, PUT, DELETE |
| Endpoint | API URL |
| Headers | Request headers |
| Body Template | For POST/PUT requests |
Dynamic Values
Use variables in your configuration:
{{param_name}}- Parameter value{{API_KEY}}- Stored secret
Code Tools
Execute custom JavaScript:
// Tool: Calculate Compound Interest
const principal = params.principal;
const rate = params.rate / 100;
const years = params.years;
const compounds = params.compounds || 12;
const amount = principal * Math.pow(1 + rate/compounds, compounds * years);
return {
result: amount.toFixed(2),
interest: (amount - principal).toFixed(2)
};What You Can Do
- Data transformations
- Calculations
- String manipulation
- Date/time operations
Limitations
- No external network calls (use API tools)
- No file system access
- Execution timeout: 5 seconds
Example: Weather Tool
Create the Tool
- Name: "Get Current Weather"
- Description: "Gets current weather for a city"
- Type: API
Configure API
- Method: GET
- Endpoint:
https://api.openweathermap.org/data/2.5/weather - Headers: (none required)
Add Parameters
city(string, required): "City name to check"units(string, optional): "metric or imperial"
Add Query Parameters
- q:
{{city}} - units:
{{units}} - appid:
{{WEATHER_API_KEY}}
Test
Test with: city = "London" Verify response contains weather data.
Storing Secrets
For API keys and sensitive data:
- Go to tool settings
- Add environment variable
- Reference as
{{VAR_NAME}}
Secrets are:
- Encrypted at rest
- Never exposed in logs
- Only used during execution
Testing Tools
Create Test Cases
Define expected inputs and outputs:
Test Case: Basic lookup
Input: { "city": "London" }
Expected: Response contains "temp"Run Tests
- Click "Test" button
- Review output
- Fix issues if any
- Save when working
Common Patterns
Authentication
Headers:
Authorization: Bearer {{API_KEY}}
X-API-Key: {{API_KEY}}POST with Body
Method: POST
Body:
{
"query": "{{search_term}}",
"limit": {{limit}}
}Response Transformation
Code tool to transform API response:
const data = params.api_response;
return {
summary: data.items.map(i => i.name).join(", "),
count: data.items.length
};Common Questions
Next Steps
Was this page helpful? Let us know!
Report an issue