Skip to content

Tool reference ​

Every tool the agent can call. Inputs are validated against a JSON Schema (draft-07 subset) before dispatch — invalid arguments produce an is_error tool result the model can recover from.

file_read ​

Read a UTF-8 file relative to the workspace root.

FieldTypeRequiredNotes
pathstring✅Workspace-relative. Refused if it escapes the workspace via .., absolute paths, or symlinks resolving outside the root.
start_lineinteger ≥ 1First line to return (1-indexed, inclusive).
end_lineinteger ≥ 1Last line to return (1-indexed, inclusive).

Output is capped at 50 KB. If the file is larger, the tail is truncated and a truncated: true marker appears in the header.

list_dir ​

Single-level directory listing.

FieldTypeRequired
pathstring(default: workspace root)

Subdirectories get a trailing /. Use glob for recursive discovery.

grep ​

Regex search over the workspace.

FieldTypeRequiredNotes
patternstring✅JavaScript RegExp source.
pathstringLimit search to a workspace-relative subdirectory.
case_sensitivebooleanDefault false.
max_matchesintegerCap, 1–500. Default 100.

Output: up to max_matches rows of path:line:text. Files larger than 256 KB are skipped. Skips node_modules, .git, dist, build, out, target, .gradle, .next, .cache, coverage, __pycache__, .venv, etc.

glob ​

File-path glob.

FieldTypeRequiredNotes
patternstring✅Supports **, *, ?, {a,b} brace alternation.
max_resultsintegerCap, 1–2000. Default 200.

Returns matching paths sorted lexicographically. The workspace index never contains .. components, so a pattern like ../*.ts structurally cannot escape.

file_edit ​

Atomic SEARCH/REPLACE.

FieldTypeRequiredNotes
pathstring✅Must already exist — use file_write for new files.
searchstring✅Exact text. Must match byte-for-byte and exactly once.
replacestring✅Replacement text.

Zero matches → is_error: true with the "did not match" detail. Multiple matches → is_error: true with a "must be unique — include more context" hint. Single match → atomic write. Line endings are normalised; the file's dominant EOL is preserved.

file_write ​

Create a new file (or overwrite if explicitly allowed).

FieldTypeRequiredNotes
pathstring✅Workspace-relative. Parent directories are created automatically.
contentstring✅Full file body.
overwritebooleanDefault false. When false, an existing file produces is_error: true with a "use file_edit instead" hint.

bash ​

Run a shell command via /bin/sh -c. Always prompts for per-call approval with the literal command, regardless of the configured approval policy.

FieldTypeRequiredNotes
commandstring✅Passed to /bin/sh -c.
cwdstringWorkspace-relative. Default workspace root.
timeout_msinteger100–120 000. Default 30 000. SIGKILL on timeout.

Output: exit_code, stdout (truncated to 10 KB), stderr (10 KB). Aborts if the run's AbortSignal fires.

How tools are exposed to the model ​

Each provider translates the tool registry into its own tool-calling shape:

  • Anthropic Claude — tool_use content blocks with input_schema (the JSON Schema literally).
  • OpenAI-compatible — tools: [{ type: 'function', function: { name, description, parameters } }] with index-keyed delta reassembly.
  • GitHub Copilot (vscode.lm) — LanguageModelChatTool[] passed per-request to model.sendRequest. Caramelo does not call vscode.lm.registerTool (that registers extension-wide; we want per-request scope).

The same JSON Schema shape works across all three vendors — no per-provider translation layer.

Released under the MIT License.