From 3fdee8efc622fe7dca17da8c122326cf0a526ba7 Mon Sep 17 00:00:00 2001 From: Yakuphan Yucel Date: Sun, 26 Apr 2026 02:37:51 +0300 Subject: [PATCH] =?UTF-8?q?docs+chore(filesystem):=20batch=20Info=20findin?= =?UTF-8?q?gs=20=E2=80=94=20read=5Ffile=20deprecation=20signal=20+=20read?= =?UTF-8?q?=5Fmedia=5Ffile=20docstring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - read_file: add structured deprecation signal via SDK `_meta` slot (`{ deprecated: true, replacement: "read_text_file" }`). The human-readable DEPRECATED notice in title/description already exists; this adds a programmatic signal that MCP clients can detect without parsing English. - read_media_file: rewrite description to add when-to-use guidance (binary files only; for text, use read_text_file — base64 inflates plain text ~33%) and document the MIME-type fallback behaviour (unknown extensions silently fall back to application/octet-stream as a generic blob). No behavioural change. Pure docstring + metadata edits. --- src/filesystem/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/filesystem/index.ts b/src/filesystem/index.ts index 7b67e63e58..e8eb5ddfa0 100644 --- a/src/filesystem/index.ts +++ b/src/filesystem/index.ts @@ -217,7 +217,8 @@ server.registerTool( description: "Read the complete contents of a file as text. DEPRECATED: Use read_text_file instead.", inputSchema: ReadTextFileArgsSchema.shape, outputSchema: { content: z.string() }, - annotations: { readOnlyHint: true } + annotations: { readOnlyHint: true }, + _meta: { deprecated: true, replacement: "read_text_file" } }, readTextFileHandler ); @@ -250,7 +251,11 @@ server.registerTool( { title: "Read Media File", description: - "Read an image or audio file. Returns the base64 encoded data and MIME type. " + + "Read a binary file (image or audio) and return its base64-encoded data with detected MIME type. " + + "Use this tool for binary content such as PNG/JPEG/GIF/WebP/BMP/SVG images or MP3/WAV/OGG/FLAC audio; " + + "for plain-text files use read_text_file instead, since base64 encoding inflates text payloads ~33% with no benefit. " + + "MIME type is derived from the file extension; unknown extensions silently fall back to application/octet-stream " + + "and are returned with a generic \"blob\" content type. " + "Only works within allowed directories.", inputSchema: { path: z.string()