Read
Reads a file through the agent’s sandbox. Text files return cat -n style numbered lines so the model can cite path:line, with offset and limit for paging through large files. Images (png/jpg/jpeg/gif/webp) and binary documents (pdf/doc/docx/xls/xlsx) return as media content blocks when the model accepts media; otherwise make_read(media=False) / makeRead({ media: false }) returns a short text placeholder describing the file.
Supported in: Python, TypeScript (Node.js).
Example:
from strands import Agentfrom strands.vended_tools import read
agent = Agent(tools=[read])agent("Read /etc/hosts and summarize what it maps.")import { Agent } from '@strands-agents/sdk'import { read } from '@strands-agents/sdk/vended-tools/read'
const agent = new Agent({ tools: [read] })await agent.invoke('Read /etc/hosts and summarize what it maps.')