Skip to content

Commit dd88670

Browse files
committed
Update doc strings for invocation_state
1 parent 024e8fc commit dd88670

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/strands/tools/decorator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ def inject_special_parameters(
265265
Args:
266266
validated_input: The validated input parameters (modified in place).
267267
tool_use: The tool use request containing tool invocation details.
268-
invocation_state: Context for the tool invocation, including agent state.
268+
invocation_state: Caller-provided kwargs that were passed to the agent when it was invoked (agent(),
269+
agent.invoke_async(), etc.).
269270
"""
270271
if self._context_param and self._context_param in self.signature.parameters:
271272
tool_context = ToolContext(
@@ -435,7 +436,8 @@ async def stream(self, tool_use: ToolUse, invocation_state: dict[str, Any], **kw
435436
436437
Args:
437438
tool_use: The tool use specification from the Agent.
438-
invocation_state: Context for the tool invocation, including agent state.
439+
invocation_state: Caller-provided kwargs that were passed to the agent when it was invoked (agent(),
440+
agent.invoke_async(), etc.).
439441
**kwargs: Additional keyword arguments for future extensibility.
440442
441443
Yields:

src/strands/types/tools.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ class ToolContext:
132132
tool_use: The complete ToolUse object containing tool invocation details.
133133
agent: The Agent instance executing this tool, providing access to conversation history,
134134
model configuration, and other agent state.
135-
invocation_state: Keyword arguments passed to agent invocation methods (agent(), agent.invoke_async(), etc.).
136-
Provides access to invocation-specific context and parameters.
135+
invocation_state: Caller-provided kwargs that were passed to the agent when it was invoked (agent(),
136+
agent.invoke_async(), etc.).
137137
138138
Note:
139139
This class is intended to be instantiated by the SDK. Direct construction by users
@@ -249,7 +249,8 @@ def stream(self, tool_use: ToolUse, invocation_state: dict[str, Any], **kwargs:
249249
250250
Args:
251251
tool_use: The tool use request containing tool ID and parameters.
252-
invocation_state: Context for the tool invocation, including agent state.
252+
invocation_state: Caller-provided kwargs that were passed to the agent when it was invoked (agent(),
253+
agent.invoke_async(), etc.).
253254
**kwargs: Additional keyword arguments for future extensibility.
254255
255256
Yields:

0 commit comments

Comments
 (0)