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
| Tool | Description | Permission Key |
|---|---|---|
bash | Execute shell commands | bash |
edit | Modify files using exact string replacements | edit |
write | Create new files or overwrite existing | edit |
read | Read file contents | read |
grep | Search file contents using regex | grep |
glob | Find files by pattern matching | glob |
apply_patch | Apply patches to files | edit |
skill | Load a skill and return its content | skill |
skill_manage | Create, read, update, and delete local skills | skill |
agent | Create, read, update, and delete local agents | agent |
loop | Create, read, update, and delete loop definitions | loop |
tfcode_config | Read and update config sections (reviewer, model_swap, loops) | tfcode_config |
todowrite | Manage todo lists during sessions | todowrite |
webfetch | Fetch web content | webfetch |
websearch | Search the web for information | websearch |
question | Ask the user questions during execution | question |
lsp | Interact 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
| Action | Description |
|---|---|
list | List all agents (local, native, and TF-synced) with source labels |
read | Read a specific agent's full config (frontmatter + prompt) |
create | Create a new agent markdown file (refuses to overwrite) |
update | Update an existing local agent's frontmatter and/or prompt |
delete | Delete a local agent file (refuses for native or TF-synced) |
Parameters
| Parameter | Type | Required for | Description |
|---|---|---|---|
action | list | read | create | update | delete | all | The CRUD action to perform |
name | string | read/update/delete | Agent name |
description | string | — | When to use this agent |
mode | subagent | primary | all | — | Agent visibility — subagent = hidden from switcher, invocable via @ and task; primary = switchable agent; all = both. See Agents → Agent modes. |
model | string | — | Model in provider/model format |
hidden | boolean | — | Hide from @ autocomplete (subagents only) |
color | string | — | Hex color or theme name |
steps | number | — | Max agentic iterations |
permission | object | — | Permission rules (see Permissions) |
temperature | number | — | Temperature for the agent's model |
top_p | number | — | Top_p for the agent's model |
variant | string | — | Default model variant for this agent |
prompt | string | — | 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
}
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
| Parameter | Type | Required for | Description |
|---|---|---|---|
action | list | read | create | update | delete | all | The CRUD action to perform |
name | string | read/update/delete | Skill name |
description | string | create | Skill description |
content | string | — | 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
| Parameter | Type | Required for | Description |
|---|---|---|---|
action | list | read | create | update | delete | all | The CRUD action to perform |
name | string | read/update/delete | Loop name |
description | string | — | Loop description |
steps | array of step objects | create | Ordered 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
| Section | Config Key | Description |
|---|---|---|
reviewer | reviewer | Reviewer model configuration |
model_swap | model_swap | Model swap configuration |
loops_settings | loops | Top-level loops settings (compaction, guards, auto) |
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
| Action | Description |
|---|---|
read | Read a config section's current value |
update | Update a config section (deep-merges existing) |
delete | Remove 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.