@@ -7,7 +7,9 @@ import { Mode, getModeConfig, isToolAllowedForMode, getGroupName } from "../../.
77import { ToolArgs } from "./types"
88import { getExecuteCommandDescription } from "./execute-command"
99import { getReadFileDescription } from "./read-file"
10+ import { getSimpleReadFileDescription } from "./simple-read-file"
1011import { getFetchInstructionsDescription } from "./fetch-instructions"
12+ import { shouldUseSingleFileRead } from "@roo-code/types"
1113import { getWriteToFileDescription } from "./write-to-file"
1214import { getSearchFilesDescription } from "./search-files"
1315import { getListFilesDescription } from "./list-files"
@@ -29,7 +31,14 @@ import { CodeIndexManager } from "../../../services/code-index/manager"
2931// Map of tool names to their description functions
3032const toolDescriptionMap : Record < string , ( args : ToolArgs ) => string | undefined > = {
3133 execute_command : ( args ) => getExecuteCommandDescription ( args ) ,
32- read_file : ( args ) => getReadFileDescription ( args ) ,
34+ read_file : ( args ) => {
35+ // Check if the current model should use the simplified read_file tool
36+ const modelId = args . settings ?. modelId
37+ if ( modelId && shouldUseSingleFileRead ( modelId ) ) {
38+ return getSimpleReadFileDescription ( args )
39+ }
40+ return getReadFileDescription ( args )
41+ } ,
3342 fetch_instructions : ( args ) => getFetchInstructionsDescription ( args . settings ?. enableMcpServerCreation ) ,
3443 write_to_file : ( args ) => getWriteToFileDescription ( args ) ,
3544 search_files : ( args ) => getSearchFilesDescription ( args ) ,
@@ -64,6 +73,7 @@ export function getToolDescriptionsForMode(
6473 partialReadsEnabled ?: boolean ,
6574 settings ?: Record < string , any > ,
6675 enableMcpServerCreation ?: boolean ,
76+ modelId ?: string ,
6777) : string {
6878 const config = getModeConfig ( mode , customModes )
6979 const args : ToolArgs = {
@@ -76,6 +86,7 @@ export function getToolDescriptionsForMode(
7686 settings : {
7787 ...settings ,
7888 enableMcpServerCreation,
89+ modelId,
7990 } ,
8091 experiments,
8192 }
@@ -145,6 +156,7 @@ export function getToolDescriptionsForMode(
145156export {
146157 getExecuteCommandDescription ,
147158 getReadFileDescription ,
159+ getSimpleReadFileDescription ,
148160 getFetchInstructionsDescription ,
149161 getWriteToFileDescription ,
150162 getSearchFilesDescription ,
0 commit comments