When the language model wants to take an action it writes JavaScript and submits it toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Effectful-Tech/clanka/llms.txt
Use this file to discover all available pages before exploring further.
AgentExecutor. Inside that sandbox every tool is available as a plain async function — no imports needed. The declarations below are derived directly from AgentTools.ts and are injected into the model’s system prompt so the model knows the exact signatures.
All tool functions are globals in the sandbox. The model calls them with
await because they are async. Variables and state are not shared between separate script executions.File system tools
readFile
Read a file and return its content as a string, or null if the file does not exist. Optionally slice by line range.
writeFile
Write content to a file. Parent directories are created automatically. Prefer applyPatch when updating existing files to avoid accidental overwrites.
removeFile
Delete a file from disk.
renameFile
Move or rename a file. Parent directories are created if they do not exist.
ls
List the entries in a directory.
glob
Return all file paths matching a glob pattern, relative to the working directory.
applyPatch
Apply a git/unified diff patch that can add, update, move, or delete multiple files in a single call. Returns a summary of the files changed.
Search tools
rg
Run ripgrep against the working directory. Returns matching lines (up to maxLines, default 500).
search
Semantic code search powered by embeddings. Describe what you are looking for in natural language and receive the most relevant code chunks.
search is only available when a SemanticSearch layer is provided to the executor. See Semantic search for setup instructions.Shell and CLI tools
bash
Run a shell command and return combined stdout/stderr. The default timeout is 120 000 ms; the maximum is 240 000 ms.
gh
Run the GitHub CLI (gh) with the provided arguments. The working directory is set to the agent’s configured directory. Use this instead of bash("gh …").
Web tools
webSearch
Search the web using the configured Exa search integration. Returns a formatted string of results.
fetchMarkdown
Fetch a URL and return its content converted to Markdown.
Sub-agent tools
delegate
Spawn a sub-agent to complete a task. The parent agent waits for the sub-agent to call taskComplete and then receives the summary. Sub-agents share the same tool set but run with a fresh conversation history.
Task management tools
The agent maintains an in-memory todo list scoped to the current executor instance. These tools let the model track its own progress across multiple tool calls.listTodos
addTodo
updateTodo
clearTodos
Control tools
taskComplete
Signal that the task is fully done and provide the final output message. Calling this causes the output stream to end with AgentFinished.
sleep
Pause execution for a given number of milliseconds.
Example: multi-step file operation
The following is representative of how the model would use several tools together in a single script:Globals also available
In addition to tool functions, the sandbox exposes:console— standardconsole.log,console.error, etc. All output is captured and sent back to the model.fetch— the globalfetchAPI for making HTTP requests.process— explicitly set toundefined; Node.js APIs are not available.