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

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
descriptionstringWhen to use this agent
modesubagent | primary | allAgent visibility — subagent = hidden from switcher, invocable via @ and task; primary = switchable agent; all = both. See Agents → Agent modes.
modelstringModel in provider/model format
hiddenbooleanHide from @ autocomplete (subagents only)
colorstringHex color or theme name
stepsnumberMax agentic iterations
permissionobjectPermission rules (see Permissions)
temperaturenumberTemperature for the agent's model
top_pnumberTop_p for the agent's model
variantstringDefault model variant for this agent
promptstringThe 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
contentstringThe 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
descriptionstringLoop 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": "plan"
},
{ "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
}
}

Disable Tools

Globally:

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

Per-Agent Overrides

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

Agent permissions override global settings.