Skip to main content

Overview

The Read tool supports images and PDFs for Claude’s vision and document understanding capabilities. File type is detected automatically based on extension, and content is base64-encoded for the LLM.

Supported Formats

Usage

File type is detected by extension — no special handling needed:

Tool Result Types

The framework uses different content types internally:

Prompt Caching

Images and PDFs support prompt caching automatically:
The last content block gets cache control applied automatically. This reduces costs when analyzing the same files multiple times.

File Attachments

Images and PDFs can also be sent via attachment tags:
See File Attachments for details.

Limitations

  • Extension-based detection: File type is determined by extension, not file contents.
  • No streaming: Files are read completely before processing.
  • No image generation: The SDK only supports reading/analyzing images.
  • Provider support: Image/PDF analysis requires Claude (AnthropicProvider). Other providers may not support these features.

Next Steps

File Attachments

Attachment tags for files

Prompt Caching

Cache images/PDFs for cost savings