Built-in Tools
Complete reference for every tool available to the AI out of the box — parameters, return values, and examples.
info How Tools Work
LexiChat uses the Ollama tool-calling API. When you send a message, the model receives a list of available tools alongside your message. If it decides a tool is needed, it emits a structured JSON call — LexiChat intercepts this, executes the tool in the Rust backend, and feeds the result back to the model in the next turn.
The loop can repeat multiple times in a single response if the model needs to call several tools.
web_search
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | yes | The search query string |
A list of up to 10 results, each containing: title, url, and snippet (short excerpt).
// Example model call
{
"name": "web_search",
"arguments": {
"query": "latest Ollama release notes"
}
}
// Returned to model
[
{
"title": "Ollama 0.6 Released — New Features",
"url": "https://ollama.com/blog/release-0.6",
"snippet": "Ollama 0.6 brings structured outputs, improved..."
},
...
]
read_file
| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | yes | Absolute path to the file (must be within an allowed directory) |
The full UTF-8 contents of the file as a string. Binary files return an error.
// Example: ask the AI to summarise a document
// User says: "Summarise ~/Documents/LexiChat/report.md"
{
"name": "read_file",
"arguments": {
"path": "/Users/alice/Documents/LexiChat/report.md"
}
}
write_file
| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | yes | Full absolute path including filename and extension |
| content | string | yes | The text content to write. Overwrites the file if it already exists. |
// User says: "Write a haiku about mountains and save it"
{
"name": "write_file",
"arguments": {
"path": "/Users/alice/Documents/LexiChat/mountain_haiku.txt",
"content": "Silent peaks above\nClouds drift past ancient granite\nEcho of the wind"
}
}
list_directory
| Parameter | Type | Required | Description |
|---|---|---|---|
| path | string | yes | Absolute path to the directory to list |
A list of filenames and subdirectory names in the specified directory (one level deep, not recursive).
// User says: "What files do I have in my LexiChat folder?"
{
"name": "list_directory",
"arguments": {
"path": "/Users/alice/Documents/LexiChat"
}
}
// Returned to model
["report.md", "mountain_haiku.txt", "notes/", "archive/"]
visibility Tool Indicators in Chat
Every time the AI calls a tool, a small indicator appears inline in the conversation so you can see exactly what it's doing:
⚙ web_search("ollama release")
— shown while the search is running
⚙ read_file("/Users/alice/Documents/report.md")
— shown while reading