src/core/prompts/system-prompt/tools/README.md
This directory contains the tool registration system for Cline tools. The system automatically collects and registers all tool variants with the ClineToolSet provider.
Each tool file in this directory exports a {toolName}_variants array containing tool specifications for different prompt variants (e.g., Claude, GPT). The registration system automatically imports all these variants and registers them with the ClineToolSet provider.
register.ts - Main registration function and utilitiesexample-usage.ts - Example usage patternsindex.ts - Exports all tools and the registration function{toolName}_variants arrayimport { registerAllToolVariants } from "./tools/register";
// Register all tool variants during application initialization
registerAllToolVariants();
import { getToolRegistrationSummary } from "./tools/register";
const summary = getToolRegistrationSummary();
console.log(summary);
// Output: { "write_to_file": ["claude"], "execute_command": ["claude", "gpt"], ... }
import { ClineToolSet } from "../registry/ClineToolSet";
import { PromptVariant } from "@/shared/tools";
// Get all tools for a specific variant
const claudeTools = ClineToolSet.getTools(PromptVariant.CLAUDE);
// Get a specific tool by name
const writeToFileTool = ClineToolSet.getToolByName("write_to_file", PromptVariant.CLAUDE);
Each tool file follows this pattern:
import { ClineDefaultTool, PromptVariant, type ClineToolSpec } from "@/shared/tools";
const claude: ClineToolSpec = {
variant: PromptVariant.CLAUDE,
id: "tool_name",
description: "Tool description",
parameters: [
// Parameter definitions
],
};
const gpt: ClineToolSpec = {
variant: PromptVariant.GPT,
id: "tool_name_gpt",
description: "Tool description for GPT",
parameters: [
// Parameter definitions
],
};
export const tool_name_variants = [claude, gpt];
The following tools are currently registered:
access_mcp_resourceask_followup_questionattempt_completionbrowser_actionexecute_commandfocus_chainlist_code_definition_nameslist_filesload_mcp_documentationnew_taskplan_mode_respondread_filereplace_in_filesearch_filesuse_mcp_toolweb_fetch (exported as get_web_fetch_variants)write_to_file{tool_name}.ts{tool_name}_variants array with tool specificationsindex.tsregister.ts