Skip to main content

Tools

Tools allow the LLM to perform actions in your codebase. TF Code comes with built-in tools and supports MCP servers and custom tools via plugins.

Configure​

Use the permission field to control tool behavior — allow, deny, or require approval:

{
"permission": {
"edit": "allow",
"bash": "ask",
"webfetch": "deny"
}
}

Wildcard patterns:

{
"permission": {
"mymcp_*": "ask"
}
}

Built-in Tools​

ToolDescriptionPermission Key
bashExecute shell commandsbash
editModify files using exact string replacementsedit
writeCreate new files or overwrite existingedit
readRead file contentsread
grepSearch file contents using regexgrep
globFind files by pattern matchingglob
apply_patchApply patches to filesedit
skillLoad a skill and return its contentskill
skill_manageCreate, read, update, and delete local skillsskill
agentCreate, read, update, and delete local agentsagent
loopCreate, read, update, and delete loop definitionsloop
tfcode_configRead and update config sections (reviewer, model_swap, loops)tfcode_config
todowriteManage todo lists during sessionstodowrite
webfetchFetch web contentwebfetch
websearchSearch the web for informationwebsearch
questionAsk the user questions during executionquestion
lspInteract with LSP servers (experimental)lsp
tf_toolingCall ToothFairyAI workspace tools by writing JavaScripttf_tooling
renderScreenshot a page with headless Chrome (vision models only)render
computerControl the local OS GUI: mouse, keyboard, screen capturecomputer
screenshotSee the user's screen on demand (read-only; vision models)screenshot
voice_updateSpeak a short message out loud (TTS); requires voice modevoice_update

Note: write and apply_patch are controlled by the edit permission key.

Agent Management​

The agent tool lets agents create, read, update, and delete local agents stored as markdown files in .tfcode/agent/<name>.md. TF-synced agents (from ToothFairyAI) and native agents are read-only and cannot be modified.

Actions​

ActionDescription
listList all agents (local, native, and TF-synced) with source labels
readRead a specific agent's full config (frontmatter + prompt)
createCreate a new agent markdown file (refuses to overwrite)
updateUpdate an existing local agent's frontmatter and/or prompt
deleteDelete a local agent file (refuses for native or TF-synced)

Parameters​

ParameterTypeRequired forDescription
actionlist | read | create | update | deleteallThe CRUD action to perform
namestringread/update/deleteAgent name
descriptionstring—When to use this agent
modesubagent | primary | all—Agent visibility — subagent = hidden from switcher, invocable via @ and task; primary = switchable agent; all = both. See Agents → Agent modes.
modelstring—Model in provider/model format
hiddenboolean—Hide from @ autocomplete (subagents only)
colorstring—Hex color or theme name
stepsnumber—Max agentic iterations
permissionobject—Permission rules (see Permissions)
temperaturenumber—Temperature for the agent's model
top_pnumber—Top_p for the agent's model
variantstring—Default model variant for this agent
promptstring—The agent's system prompt (markdown body)

Examples​

Create a translator subagent:

{
"action": "create",
"name": "translator",
"description": "Translate content for a specified locale",
"mode": "subagent",
"prompt": "You are a professional translator specializing in technical documentation."
}

Update an agent's temperature:

{
"action": "update",
"name": "translator",
"temperature": 0.7
}
note

The model parameter is optional. When omitted, the agent inherits the session's active model — dynamically resolved from your ToothFairyAI workspace. Only set model if the agent should always use a specific model. Use /models in the TUI to discover available models.

List all agents:

{ "action": "list" }

Delete an agent:

{ "action": "delete", "name": "translator" }

Skill Management​

The skill_manage tool lets agents create, read, update, and delete local skills stored as SKILL.md files in .tfcode/skill/<name>/SKILL.md. TF-synced skills (from ToothFairyAI, locations starting with tf://) are read-only.

Actions​

Same five actions as the agent tool: list, read, create, update, delete.

Parameters​

ParameterTypeRequired forDescription
actionlist | read | create | update | deleteallThe CRUD action to perform
namestringread/update/deleteSkill name
descriptionstringcreateSkill description
contentstring—The skill content (markdown body)

Examples​

Create a deployment skill:

{
"action": "create",
"name": "deploy",
"description": "Deployment workflows and runbooks",
"content": "# Deploy Skill\n\nSteps to deploy to production..."
}

Loop Management​

The loop tool lets agents create, read, update, and delete loop definitions in the project config. See Loops for full loop documentation.

Actions​

Same five actions: list, read, create, update, delete.

Parameters​

ParameterTypeRequired forDescription
actionlist | read | create | update | deleteallThe CRUD action to perform
namestringread/update/deleteLoop name
descriptionstring—Loop description
stepsarray of step objectscreateOrdered steps for the loop

Each step object has: name (required), prompt (required), agent, skill, review, model — see Loops → Step.

Example​

{
"action": "create",
"name": "fix-bug",
"description": "Read, build, test, review",
"steps": [
{
"name": "read",
"prompt": "Read and understand the task.",
"agent": "general"
},
{ "name": "build", "prompt": "Implement the change." },
{ "name": "test", "prompt": "Run tests. If failing, loop back to build." },
{ "name": "review", "prompt": "Review for correctness.", "review": true }
]
}

Config Management​

The tfcode_config tool lets agents read and update top-level config sections without editing JSON manually. It also supports deleting a section.

Sections​

SectionConfig KeyDescription
reviewerreviewerReviewer model configuration
model_swapmodel_swapModel swap configuration
loops_settingsloopsTop-level loops settings (compaction, guards, auto)
note

Loop definitions are managed via the loop tool, not tfcode_config. The loops_settings section only covers top-level settings (compaction_threshold, compaction_model, max_step_repeats, max_transitions, auto).

Actions​

ActionDescription
readRead a config section's current value
updateUpdate a config section (deep-merges existing)
deleteRemove a config section from config

Examples​

Read reviewer config:

{ "action": "read", "section": "reviewer" }

Enable model swap with a candidate list:

{
"action": "update",
"section": "model_swap",
"value": {
"enabled_for": ["build"],
"models": [
{
"id": "toothfairyai/glm-5p2",
"instruction": "Use for deep reasoning"
},
{
"id": "toothfairyai/glm-5p2",
"instruction": "Use for quick lookups"
}
]
}
}

Configure loops compaction settings:

{
"action": "update",
"section": "loops_settings",
"value": {
"compaction_threshold": 0.6,
"max_step_repeats": 5
}
}

Workspace Tooling (tf_tooling)​

The tf_tooling tool lets agents call your synced ToothFairyAI workspace tools — API functions, agent skills, and database scripts — by writing JavaScript instead of one tool call at a time. This is the fastest way to chain calls, poll, or reshape results.

Prerequisite: run tfcode sync so the tool catalog is cached locally.

How it works​

The agent writes JavaScript that runs in a confined sandbox (no filesystem, network, or process access — only the tf namespace and plain JavaScript):

const projects = await tf.tools.get_kanban_projects();
const open = await tf.tools.get_tickets({
status: "open",
project: projects[0].id,
});
return open.filter((t) => t.priority === "high");
  • await tf.tools.<name>({...args}) — call a synced tool by its sanitized name
  • tf.list() — inspect available tools, types, and descriptions at runtime
  • The last expression is JSON-serialized back to the agent

Authentication​

Credentials never enter the sandbox:

  • Tools executed by ToothFairyAI (tf_proxy) run through the workspace function core with workspace credentials — the sandbox only ever holds closures.
  • Tools that expect a user-provided key read it from an environment variable at call time (TF_TOOL_KEY__<TOOL_NAME>) and error with a clear message when unset.
note

mcp_server type workspace tools are not callable from tf_tooling yet — connect them as MCP servers instead.

Vision Rendering (render)​

The render tool screenshots a URL or local HTML file with headless Chrome and attaches the image, letting the agent visually inspect UI work. It is only exposed when the active model supports vision (e.g. models with supportsVision enabled in your workspace).

render("https://localhost:3000") → screenshot attached to context

Requirements and tuning:

  • Chrome/Chromium must be installed (standard macOS/Linux/Windows locations are probed automatically).
  • Set TF_CHROME_PATH to point at a specific binary.
  • Window size defaults to 1280×800; pages get a virtual-time budget to settle before capture.

Output Limits​

Tool outputs are bounded at two levels so one runaway call — or many parallel ones — can't flood the context:

LevelLimitBehavior
Per output2000 lines / 50KBFull output saved to disk; the tool returns a preview plus a hint to Grep/Read the saved file
Per turn200KB aggregate per assistant turnOnce spent, further outputs in the same turn collapse to small previews (full content still saved to disk)

The turn budget resets on every assistant turn. Tools that manage their own truncation are exempt from the per-output cap but still consume the turn budget.

Disable Tools​

Globally:

{
"tools": {
"write": false,
"bash": false
}
}

Per-Agent Overrides​

{
"permission": {
"edit": "deny"
},
"agent": {
"build": {
"permission": {
"edit": "ask"
}
}
}
}

Agent permissions override global settings.