Skip to content

Commit 95c8313

Browse files
authored
fix: update direct tool call references to use agent.tool.tool_name format (#56)
1 parent 912e110 commit 95c8313

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/strands/agent/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
The Agent interface supports two complementary interaction patterns:
77
88
1. Natural language for conversation: `agent("Analyze this data")`
9-
2. Method-style for direct tool access: `agent.tool_name(param1="value")`
9+
2. Method-style for direct tool access: `agent.tool.tool_name(param1="value")`
1010
"""
1111

1212
import asyncio
@@ -515,7 +515,7 @@ def _record_tool_execution(
515515
"""
516516
# Create user message describing the tool call
517517
user_msg_content = [
518-
{"text": (f"agent.{tool['name']} direct tool call\nInput parameters: {json.dumps(tool['input'])}\n")}
518+
{"text": (f"agent.tool.{tool['name']} direct tool call.\nInput parameters: {json.dumps(tool['input'])}\n")}
519519
]
520520

521521
# Add override message if provided

tests/strands/agent/test_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ def test_agent_tool_user_message_override(agent):
566566
},
567567
{
568568
"text": (
569-
"agent.tool_decorated direct tool call\n"
569+
"agent.tool.tool_decorated direct tool call.\n"
570570
"Input parameters: "
571571
'{"random_string": "abcdEfghI123", "user_message_override": "test override"}\n'
572572
),

0 commit comments

Comments
 (0)