read_file
Read file content from specified paths with optional line range selection and automatic encoding detection for text and image files.
Instructions
Read file content with optional line range.
Args: file_path: Absolute path to the file. offset: Start line (negative reads from end). length: Max lines to return. encoding: "auto"/None for auto-detection, or specify: utf-8, gbk, gb2312.
Returns: dict with keys: - content: File content as string - mimeType: MIME type of the file - isImage: Boolean indicating if file is an image - encoding: Detected encoding (e.g., "utf_8", "gbk", "gb2312") - encodingConfidence: Confidence score for encoding detection (float or None)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| offset | No | ||
| length | No | ||
| encoding | No |