Skip to content

[Bug] Tool calling unreliable/broken in Groq #4090

Description

@awiegersma

Description

Tool calling is working very unreliably, and unpredictably with Agno and Groq. Often tool calls fail with error code 400, failed to call a function. Also many LLM calls are generated by the Agno agent which causes API resource usage issues.

Steps to Reproduce

To reproduce I have modified an Agno documentation example team_workflow.py to use Groq instead of OpenAI, so model=Groq(id="llama-3.3-70b-versatile").

Agent Configuration (if applicable)

reddit_researcher = Agent( name="Reddit Researcher", role="Research a topic on Reddit", model=Groq(id="llama-3.3-70b-versatile"), tools=[searxng_tool], add_name_to_instructions=True, instructions=dedent(""" You are a Reddit researcher. You will be given a topic to research on Reddit. You will need to find the most relevant posts on Reddit. """), )

Expected Behavior

Tool call succeeding without error

Actual Behavior

Outputs: Working...ERROR Error calling Groq API: Error code: 400 - {'error': {'message': "Failed to call a function. Please adjust your prompt. See 'failed_generation' for more details.", 'type':
'invalid_request_error', 'code': 'tool_use_failed', 'failed_generation': '### Top Stories from Reddit\nAs the Reddit Researcher, I have found the following top stories on Reddit

Screenshots or Logs (if applicable)

No response

Environment

### Environment
MacOS 15.5
Agno 1.7.7

Possible Solutions (optional)

No response

Additional Context

  • Error happens in both single agent and team of agents.
  • Other LLMs like Groq meta-llama/llama-4-maverick-17b-128e-instruct, gemma2-9b-it fail as well in tool calling.
  • Sometimes tool call works, sometimes it doesn't. Two successive runs of same example with same input prompt can result in one succeeding and one failing.
  • Use of other frameworks like LangChain do not generate this error using Groq for inference

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions