Skip to content

Sequential Tool Calling Failure #824

@mzazakeith

Description

@mzazakeith

Environment

  • Provider (select one):
    • Anthropic
    • OpenAI
    • Google Vertex AI
    • AWS Bedrock
    • Other:
  • PraisonAI version: PraisonAI==2.2.48
  • Operating System: macOS 15.4

Full Code

from praisonaiagents import Agent

def get_stock_price(company_name: str) -> str:
    """
    Get the stock price of a company
    
    Args:
        company_name (str): The name of the company
        
    Returns:
        str: The stock price of the company
    """
    return f"The stock price of {company_name} is 100"

def multiply(a: int, b: int) -> int:
    """
    Multiply two numbers
    """
    return a * b



agent = Agent(
    instructions="You are a helpful assistant. You can use the tools provided to you to help the user.",
    llm="gemini/gemini-2.5-flash-lite-preview-06-17",
    self_reflect=False,
    verbose=True,
    tools=[get_stock_price, multiply]
)

result = agent.chat("Get the stock price of Google and multiply it by 2")
print(result)

Steps to Reproduce

  1. install the library
  2. paste the code above
  3. run the code

Expected Behavior

Output should be provided back to the llm so that they can call another tool if needed.

Actual Behavior

Output is provided to user immediately instead of back to the llm for final parsing. This causes esquential tool calling (or tool chaining) to fail.

Additional Context

Example One:

Image

Example Two:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions