What are Tools?
Tools in Atomemo plugins are:- Executable functions that perform specific actions
- Invoked by the Hub Server with parameters and credentials
- Return structured data or error responses
- Type-safe with Zod schema validation
Basic Tool Definition
Tool Structure
Required Fields
| Field | Type | Description |
|---|---|---|
name | string | Unique identifier (kebab-case) |
display_name | Record<Locale, string> | Human-readable name |
description | Record<Locale, string> | What this tool does |
icon | string | Visual identifier (emoji/icon) |
parameters | Parameter[] | Input fields for the tool |
invoke | Function | Async function that executes the tool |
Optional Fields
| Field | Type | Description |
|---|---|---|
credentials | string[] | Required credential names |
returns | Parameter[] | Output schema definition |
examples | Example[] | Usage examples |
category | string | Tool category for organization |
Invoke Function
Theinvoke function is where your tool logic lives:
Invocation Flow
When the Hub Server invokes your tool:Parameter Types
Tools support various parameter types:String Parameter
Number Parameter
Boolean Parameter
Array Parameter
Object Parameter
Using Credentials
Tools can require credentials for authentication:Real-World Examples
Example 1: HTTP API Call
Example 2: Database Query
Example 3: File Processing
Error Handling
Handle errors properly in your tools:Best Practices
Validate inputs early
Validate inputs early
Return structured data
Return structured data
Handle rate limits
Handle rate limits
Clean up resources
Clean up resources
Use descriptive error messages
Use descriptive error messages
Testing Tools
Test your tools in debug mode:Next Steps
Add Models
Integrate AI models into your plugin
Debug Mode
Test and troubleshoot your tools