Files
letta-code/src/tools
cpacker 5e654f3daa feat: wrap skill content in <skill-name> XML tags
Skill content is now wrapped in XML tags matching the skill name
(e.g., <commit>...</commit>) so the agent can detect already-loaded
skills in the conversation turn.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>
2026-02-07 19:20:20 -08:00
..
2026-02-06 22:18:17 -08:00
2025-12-08 18:34:00 -08:00
2026-02-06 22:18:17 -08:00

Client-side tool guidelines

How to implement tools that run locally in Letta Code.

Contract

  • Function signature: (args, opts?) => Promise<{ toolReturn: string; status: "success" | "error"; stdout?: string[]; stderr?: string[] }>
  • Optional opts.signal?: AbortSignal. If you spawn a subprocess, wire this signal to it so Esc/abort can kill it cleanly. If youre pure in-process, you can ignore it.

Subprocess tools (e.g., Bash)

  • Pass the provided AbortSignal to exec/spawn so abort kills the child. Normalize abort errors to toolReturn: "User interrupted tool execution", status: "error".
  • Avoid running multiple subprocesses unless you also expose a cancel hook; we execute tools serially to avoid races.

In-process tools (read/write/edit)

  • You can ignore the signal, but still return a clear toolReturn and status.
  • Be deterministic and side-effect aware; the runner keeps tools serial to avoid file races.

Errors

  • Return a concise error message in toolReturn and set status: "error".
  • Dont console.error from tools; the UI surfaces the returned message.