Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/content/docs/user-guide/concepts/tools/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,37 @@ Find the tool in the `agent.tools` array and call its `invoke()` method. You nee
</Tab>
</Tabs>

#### Streaming Direct Tool Calls

Direct tool calls support streaming, allowing you to observe execution events in real-time without recording to message history:

```python
from strands import Agent, tool

@tool
def analyze_data(query: str) -> str:
"""Analyze data based on a query."""
return f"Analysis complete for: {query}"

agent = Agent(tools=[analyze_data])

# Async streaming
async for event in agent.tool.analyze_data.stream_async(query="sales trends"):
if "data" in event:
print(event["data"], end="")

# Sync streaming
for event in agent.tool.analyze_data.stream(query="sales trends"):
if "data" in event:
print(event["data"], end="")
```

Streaming methods yield the same [tool events](../streaming/index.md#tool-events) as agent-level streaming.

:::note
In Python, `agent.tool.my_tool(...)` is equivalent to TypeScript's `agent.tool.my_tool.invoke(...)`. Python uses `__call__` as the synchronous entry point, while TypeScript uses an explicit `.invoke()` method.
:::


## Tool Executors

Expand Down