fetch_doc
Reads Strands Agents documentation pages by returning a table of contents or a specific section, reducing tokens by fetching only the content needed.
Instructions
Read documentation pages with smart sectioning for token efficiency.
Two modes of operation:
TOC mode (omit section): Returns a table of contents with section IDs, titles, summaries, and the document's preamble so you can decide which part to read.
Section mode (provide section): Returns the full markdown content of one section, identified by the ID from the TOC (e.g., "3" or "3.2").
For small documents (under ~8KB), the full content is returned directly regardless of mode, since sectioning would add overhead without benefit.
Recommended workflow:
search_docs("your query") - find relevant URLs
fetch_doc(uri="...") - see structure, preamble, and section summaries
fetch_doc(uri="...", section="3") - read the section you need
Args: uri: Document URL (must be under https://strandsagents.com/). If empty, returns a catalog of all available document URLs with titles. section: Section ID from the TOC (e.g., "3" or "3.2"). Omit to get the table of contents.
Returns: When section is omitted (TOC mode): - url, title: Document metadata - preamble: Introductory text between page title and first section - sections: List of sections with id, level, title, summary, children
When section is provided:
- url, title: Document metadata
- section_id: Requested section ID
- section_title: Section heading text
- content: Full markdown content of the section
For small documents (under ~8KB):
- url, title: Document metadata
- document_small: true
- content: Full document content (returned automatically)
On error:
- error: Error description
- url: Requested URL
Errors are returned for unsupported URLs and failed page fetches. For
sectioned documents, unknown section IDs also return an error; `section`
is ignored when the full document is returned automatically.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uri | No | ||
| section | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |