Custom Tools
Define your own API endpoints for agents to call. Specify the URL, parameters, and authentication — the agent decides when to use it.
What Are Custom Tools?
Custom tools let your agent make HTTP requests to any external API. You define the endpoint and parameters — the agent decides when to call it based on your instructions.
Name
Unique identifier
get_weatherDescription
When to use this tool
Get current weather for a cityMethod
HTTP method
GET, POST, PUTURL
Endpoint URL
https://api.example.com/v1/dataHeaders
Add headers for authentication and content type:
| Header | Example Value |
|---|---|
Authorization | Bearer your-api-key |
Content-Type | application/json |
X-API-Key | your-api-key |
Parameters
Define parameters the agent can provide when calling the tool:
| Field | Description |
|---|---|
| Name | Parameter name (e.g., user_id) |
| Type | string, number, boolean, or object |
| Required | Whether agent must provide this |
| Description | Helps agent understand what to provide |
| Default | Optional default value |
| Location | Where parameter goes (see below) |
Parameter Locations
pathURL path segment
/users/{user_id}queryQuery string parameter
?city=tokyobodyRequest body (JSON)
{ "title": "..." }headerHTTP header
X-Custom-Header: valueExample Configurations
Weather API
Name: get_weather
Description: Get current weather for a city
Method: GET
URL: https://api.weatherapi.com/v1/current.json
Headers:
X-API-Key: your-weather-api-key
Parameters:
- name: q
type: string
required: true
description: City name or coordinates
location: query
- name: units
type: string
default: metric
location: queryCreate Ticket API
Name: create_ticket
Description: Create a support ticket
Method: POST
URL: https://api.helpdesk.com/v1/tickets
Headers:
Authorization: Bearer your-token
Content-Type: application/json
Parameters:
- name: title
type: string
required: true
location: body
- name: description
type: string
required: true
location: body
- name: priority
type: string
default: medium
location: bodySecurity Best Practices
Use read-only endpoints when possible
If agent only needs data, don't give write access
Scope API keys narrowly
Create keys with minimal permissions for MoiAgent
Don't expose sensitive data
Agent sees all response data — be careful what APIs return
Rate limit externally
Apply limits on your API side to prevent abuse
Response Handling
When a tool is called, MoiAgent:
Large responses?
Debugging Tools
Use --debug to see detailed tool execution:
You'll see tool calls, parameters, and responses in the output.