-
Notifications
You must be signed in to change notification settings - Fork 0
Tool System
ALICE's Tool System enables AI to perform real-world tasks through Function Calling. Instead of just answering questions, ALICE can read files, search directories, execute commands, and more.
Function Calling allows the LLM to:
- Decide when a tool is needed
- Choose which tool to use
- Provide parameters for the tool
- Interpret the tool's results
- Generate a natural language response
User: "How many TypeScript files are in this project?"
↓
LLM thinks: "I need to search for *.ts files"
↓
Calls: searchFiles(pattern: "**/*.ts")
↓
Tool executes and returns: { count: 25, files: [...] }
↓
LLM generates: "This project contains 25 TypeScript files..."
ALICE comes with 7 builtin tools:
| Tool | Category | Description | Platform |
|---|---|---|---|
| readFile | File System | Read file contents | All |
| listFiles | File System | List directory contents | All |
| searchFiles | File System | Search files by pattern | All |
| getCurrentDirectory | Workspace | Get current working directory | All |
| getGitInfo | Workspace | Get Git repository info | All |
| getCurrentDateTime | System | Get current date and time | All |
| executeCommand | System | Execute shell commands | All |
View detailed documentation for each tool →
User Input
↓
LLM Analysis (with tool definitions)
↓
Tool Call Decision
↓
Execute Tool
↓
Return Result to LLM
↓
Generate Natural Response
User: "Delete node_modules"
↓
LLM decides: executeCommand("rm -rf node_modules")
↓
System detects: Dangerous command!
↓
Show Confirmation Dialog:
┌─────────────────────────────┐
│ ⚠️ Dangerous Command │
│ Command: rm -rf node_modules│
│ Confirm? (y/N): │
└─────────────────────────────┘
↓
User confirms: y
↓
Execute command
↓
Return result
The LLM automatically chooses the right tool:
# Question about time → uses getCurrentDateTime
> You: What time is it?
# Question about files → uses searchFiles or listFiles
> You: Show me all JavaScript files
# Question about Git → uses getGitInfo
> You: What branch am I on?See exactly what ALICE is doing:
[🔧 readFile] Reading package.json...
[✅ readFile] File read successfully (1024 bytes)
Status indicators:
- 🔧 = Tool executing
- ✅ = Success
- ❌ = Error
⚠️ = Warning/Confirmation needed
ALICE can use multiple tools in sequence:
> You: Find all TypeScript files and tell me the total size
[🔍 searchFiles] Searching for **/*.ts...
[✅ searchFiles] Found 25 files
[📄 readFile] Reading file sizes...
[✅ readFile] Complete
Alice: Found 25 TypeScript files with a total size of 156 KB.Dangerous operations require confirmation:
- File deletion
- System commands
- Disk operations
- Network changes
All tools work consistently across:
- Windows (PowerShell)
- macOS (Bash)
- Linux (Bash)
Tools use JSON Schema for parameter validation:
// Example: searchFiles tool
{
name: "searchFiles",
parameters: {
type: "object",
properties: {
pattern: {
type: "string",
description: "Glob pattern like '**/*.ts'"
},
directory: {
type: "string",
description: "Search directory (default: current)"
}
},
required: ["pattern"]
}
}Parameters are validated before execution.
Tools are enabled by default. To disable:
Control dangerous command behavior:
{
// true: Ask for confirmation (default, recommended)
// false: Execute without asking
"dangerous_cmd": true
}Learn more about dangerous commands →
ALICE uses a smart loop to handle complex tasks:
Max Iterations: 5
Current Iteration: 0
While iteration < 5:
1. Send messages + tool definitions to LLM
2. Receive response:
- If text only: Return response, break
- If tool calls: Execute tools, continue loop
3. Add tool results to conversation
4. Iteration++
If exceeded max iterations:
Throw error: "Too many tool calls"
This prevents infinite loops while allowing multi-step operations.
Tool execution is fast:
- File operations: < 100ms
- Directory listing: < 200ms
- Git operations: < 500ms
- Commands: Varies by command
Total overhead: ~1-2 seconds per tool call (including LLM processing)
-
LM Studio Compatibility
- Requires Function Calling support
- Some models may not support tools
- Recommend: GPT-3.5/4 compatible models
-
No Tool Streaming
- Tool execution is synchronous
- LLM response streams after tools complete
-
Fixed Tool Set
- Currently 7 builtin tools
- Custom tools: Coming soon
- Custom tool support
- Tool plugins system
- Tool result caching
- Parallel tool execution
- Tool call history
See Available Tools for detailed examples of each tool.
Problem: LLM returns text instead of calling tools
Solutions:
- Check if your LLM backend supports Function Calling
- Try with OpenAI API (guaranteed support)
- Update LM Studio to latest version
Problem: Tool returns error
Solutions:
- Check file/directory permissions
- Verify path is correct
- See Troubleshooting for specific errors
- Available Tools - Detailed documentation for each tool
- Dangerous Commands - Safety features
- Architecture - How the tool system works internally
- Quick Start - Get started with tools
- Configuration - Configure tool behavior
- FAQ - Common questions about tools