Built-in Tools
Pre-built tools that agents can use to extend their capabilities.
Available Tools
| Tool | Description |
|---|---|
calculator | Math expression evaluation |
web_search | Search the web |
http_request | Make HTTP requests |
file_read | Read file contents |
file_write | Write to files |
json_parse | Parse JSON data |
base64 | Encode/decode Base64 |
Configuring Tools
Enable tools in sekuire.yml:
sekuire.ymlyaml
agents:
assistant:
name: "AI Assistant"
tools: "./tools.json"
# or inline:
tools:
- calculator
- web_search
- http_requestCalculator Tool
Evaluates mathematical expressions safely.
typescript
import { CalculatorTool } from '@sekuire/sdk';
const calc = new CalculatorTool();
const result = await calc.execute({ expression: '2 + 2 * 3' });
console.log(result); // 8HTTP Request Tool
Make HTTP requests to external APIs.
typescript
import { HttpRequestTool } from '@sekuire/sdk';
const http = new HttpRequestTool();
const result = await http.execute({
method: 'GET',
url: 'https://api.example.com/data',
headers: { 'Authorization': 'Bearer token' }
});
console.log(result);Tool Registry
Use the registry to discover and manage tools:
typescript
import { createDefaultToolRegistry } from '@sekuire/sdk';
const registry = createDefaultToolRegistry();
// List all tools
const tools = registry.list();
console.log(tools.map(t => t.name));
// Get specific tool
const calc = registry.get('calculator');Custom Tools
Define custom tools in tools.json:
tools.jsonjson
[
{
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name"
}
},
"required": ["location"]
}
}
]Then implement the handler:
typescript
// tools/get_weather.ts
export async function getWeather(params: { location: string }) {
const response = await fetch(
`https://api.weather.com/${params.location}`
);
return response.json();
}