Skip to content

Custom Tools

Extend agent capabilities with custom tools written in Lua or exposed via MCP.

Tools are functions that agents can call to interact with the world:

  • Search notes
  • Read/write files
  • Execute commands
  • Call external APIs

Create tools using the Lua scripting language:

-- tools/search_web.lua
--- Search the web for information
-- @tool name="search_web" description="Search the web for information"
-- @param query string "Search query"
function search_web(args)
local response = cru.http.get("https://api.search.com?q=" .. args.query)
return { results = response.body }
end

Expose tools via Model Context Protocol:

Config.toml
[[mcp.servers]]
name = "my-tools"
command = "my-mcp-server"
name: search_web
description: Search the web for information
parameters:
query:
type: string
description: Search query
required: true