Skip to content

File size limit (20MB) for read_file is undocumented — add to docs/tools/file-system.md #19344

Description

@eevmanu

Problem

The Gemini CLI enforces a 20MB file size limit for the read_file feature, but this important restriction is not documented anywhere in https://geminicli.com/docs or in docs/tools/file-system.md, docs/faq.md, or docs/troubleshooting.md. Users only discover the limit via obscure error messages or by inspecting the codebase.

Code Reference

The limit is hardcoded in:

const fileSizeInMB = stats.size / (1024 * 1024);
if (fileSizeInMB > 20) {
  return {
    llmContent: 'File size exceeds the 20MB limit.',
    ...
  };
}

Opportunity

This restriction should be documented in the official docs, ideally in docs/tools/file-system.md alongside the read_file tool description. This would save users confusion and make the tool easier to use.

Minimal diff suggestion

Add a note to the read_file tool section, e.g.:


read_file (ReadFile)

Reads and returns the content of a specific file. Supports text, images, audio, and PDF.

Note: Files larger than 20MB cannot be read or uploaded. Attempts will result in an error: File size exceeds the 20MB limit.


Related files:

Metadata

Metadata

Assignees

Type

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions