Custom Tools
Custom tools in Cognipeer allow developers to extend the functionality of Peers by integrating external systems such as CRM, ERP, or e-commerce platforms through HTTP requests. By creating custom tools, you can enable your AI assistants to access data and perform actions in your existing systems.
What are Custom Tools?
Custom tools are a way to define the interface between Cognipeer Peers (AI assistants) and your external APIs or services. When a user asks a Peer to perform a specific task that requires external data or actions, the Peer can call the appropriate custom tool via function calling, similar to how modern AI models use function calling capabilities.
For example, a custom tool might allow a Peer to:
- Check inventory in your e-commerce system
- Create a support ticket in your helpdesk
- Look up customer information in your CRM
- Process payments in your payment gateway
- Book appointments in your scheduling system
How Custom Tools Work
- Tool Definition: You define a tool with its actions and parameters in JSON format
- Tool Registration: The tool is registered in the Cognipeer platform
- Tool Usage: During conversations, when appropriate, your AI Peers use these tools to fetch data or perform actions
- Response Integration: The Peer incorporates the tool's response into its conversation with the user
Custom Tool Structure
A custom tool consists of:
- Tool Information: Name, label, and general properties
- Actions: Different operations the tool can perform
- Parameters: Inputs required for each action
- API Configuration: HTTP request details for each action
Basic Example
Here's a simple example of a custom tool definition:
{
"name": "WeatherTool",
"label": "Weather Information Tool",
"actions": [
{
"name": "getCurrentWeather",
"description": "Gets the current weather for a specified location",
"displayName": "Get Current Weather",
"api": {
"url": "https://api.weatherservice.com/v1/current",
"method": "GET",
"headers": {
"Authorization": "Bearer <YOUR_API_KEY>",
"Content-Type": "application/json"
}
},
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name or zip code",
"required": true
},
"units": {
"type": "string",
"description": "Temperature units (metric or imperial)",
"required": false
}
}
}
}
]
}Key Components
- Tool Name and Label: A unique identifier and display name
- Actions: Operations the tool can perform
- API Configuration: HTTP request details (URL, method, headers)
- Parameters: Structured input requirements using JSON Schema
Next Steps
To learn more about creating and using custom tools:
- Custom Tool Format: Detailed explanation of the JSON structure
- Creating Custom Tools: Step-by-step guide to building custom tools
- Tool Parameters: How to define input and output parameters
- Examples: Sample implementations and best practices

