Skip to content

fix: pass agents directly as tools in the agents-as-tools lab - #301

Open
manoj-selvakumar5 wants to merge 1 commit into
strands-agents:mainfrom
manoj-selvakumar5:fix/agents-as-tools-use-as-tool
Open

fix: pass agents directly as tools in the agents-as-tools lab#301
manoj-selvakumar5 wants to merge 1 commit into
strands-agents:mainfrom
manoj-selvakumar5:fix/agents-as-tools-use-as-tool

Conversation

@manoj-selvakumar5

Copy link
Copy Markdown
Collaborator

Description of changes:

Problem

python/01-learn/10-agents-as-tools/agent-as-tools.ipynb wraps every specialist in a @tool function that constructs a fresh Agent internally, calls it, and returnsstr(response). The same block is repeated three times.

Strands accepts an Agent directly in tools=[] and converts it using the agent'sname and description, so the wrappers are unnecessary.

Fix

Give each specialist a name and description, and pass it to the orchestrator directly.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Each specialist was wrapped in a @tool function that built a fresh Agent
internally and returned str(response). Strands accepts an Agent in tools=[]
and converts it using the agent's name and description, so the wrappers are
unnecessary.

Give each specialist a name and description and pass it to the orchestrator
directly. Names match the previous tool names, so the routing guidance in
MAIN_SYSTEM_PROMPT still resolves.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Latest scan for commit: bbe0354 | Updated: 2026-09-02 02:31:22 UTC

✅ Security Scan Report (PR Files Only)

Scanned Files

  • python/01-learn/10-agents-as-tools/agent-as-tools.ipynb

Security Scan Results

Critical High Medium Low Info
0 0 0 0 0

Threshold: High

No security issues detected in your changes. Great job!

This scan only covers files changed in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant