From a4810b585ee0bf529537f66b5619552a2229163f Mon Sep 17 00:00:00 2001 From: Mackenzie Zastrow Date: Wed, 13 Aug 2025 10:07:44 -0400 Subject: [PATCH] fix: Call-out that direct method calls must used keyword arguments Follow-up to #194 where examples were not using keyword arguments and thus not working correctly. --- docs/user-guide/concepts/tools/tools_overview.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/user-guide/concepts/tools/tools_overview.md b/docs/user-guide/concepts/tools/tools_overview.md index 02ae8268..08ae69ed 100644 --- a/docs/user-guide/concepts/tools/tools_overview.md +++ b/docs/user-guide/concepts/tools/tools_overview.md @@ -76,6 +76,13 @@ Every tool added to an agent also becomes a method accessible directly on the ag result = agent.tool.file_read(path="/path/to/file.txt", mode="view") ``` +When calling tools directly as methods, always use keyword arguments - positional arguments are *not* supported for direct method calls: + +```python +# This will NOT work - positional arguments are not supported +result = agent.tool.file_read("/path/to/file.txt", "view") # ❌ Don't do this +``` + If a tool name contains hyphens, you can invoke the tool using underscores instead: ```python