From e4259fefd1057c57e3014b9caf048047ae8cf104 Mon Sep 17 00:00:00 2001 From: yash161004 Date: Wed, 29 Jul 2026 10:05:11 +0530 Subject: [PATCH] fix(filesystem): note allowed-directories scope on read_file Every filesystem tool description ends by stating the access boundary -- "Only works within allowed directories." -- except read_file, which is the one deprecated alias. read_file is registered with ReadTextFileArgsSchema.shape and dispatches to readTextFileHandler, so it is the same schema and the same handler as read_text_file and enforces the same boundary. Only the description differs, which makes this a documentation gap rather than a behavioural one. It matters because the description is the part an LLM agent reasons over when choosing a tool. read_text_file states the constraint; its alias does not, so the same underlying operation is described to the model two different ways. Co-Authored-By: Claude Opus 5 --- src/filesystem/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filesystem/index.ts b/src/filesystem/index.ts index 234605bb13..761c312dff 100644 --- a/src/filesystem/index.ts +++ b/src/filesystem/index.ts @@ -214,7 +214,7 @@ server.registerTool( "read_file", { title: "Read File (Deprecated)", - description: "Read the complete contents of a file as text. DEPRECATED: Use read_text_file instead.", + description: "Read the complete contents of a file as text. DEPRECATED: Use read_text_file instead. Only works within allowed directories.", inputSchema: ReadTextFileArgsSchema.shape, outputSchema: { content: z.string() }, annotations: { readOnlyHint: true, openWorldHint: false }