Skip to content

Commit ebb726d

Browse files
fix bug for tool agents
1 parent a7daa61 commit ebb726d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

solana_agent/services/agent.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,13 +773,14 @@ async def _handle_tool_call(self, agent_name: str, tool_text: str) -> str:
773773

774774
def _get_tool_usage_prompt(self, agent_name: str) -> str:
775775
"""Generate marker-based instructions for tool usage."""
776-
tools = self.get_agent_tools(agent_name)
777-
if not tools:
776+
# Only include tools actually assigned to this agent
777+
agent_tools = self.tool_registry.get_agent_tools(agent_name)
778+
if not agent_tools:
778779
return ""
779780

780781
# Simplify tool representation for the prompt
781782
simplified_tools = []
782-
for tool in tools:
783+
for tool in agent_tools:
783784
simplified_tool = {
784785
"name": tool.get("name"),
785786
"description": tool.get("description"),

0 commit comments

Comments
 (0)