Skip to content

Add documentation: Patterns for handling large tool call outputs #726

@awsarron

Description

@awsarron

Summary

Document recommended patterns for handling large (multi-megabyte) tool call outputs so agent context is not polluted or exhausted.

Related: strands-agents/samples#244

Patterns to document

1. File Reference Pattern

Write large output to disk, return only the file path to the agent. Agent then uses cat, grep, jq etc. to query data lazily.

2. AfterToolCallEvent Hook

Intercept tool results via hooks and truncate/summarize before they enter context.

3. Wrapper/Pipeline Tool

Chain tools internally inside a single tool so only the compact final result enters agent context.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions