Tool Optimization

I’m using the composio.io Gmail tool for my agent.
The agent seems not very smart and fails a lot with the configuration of the tool. Is there any good practices how to configure them?
I’m using a llama 3.1 Ollama Model for the LLM

# Agent: Email Classification Expert
## Thought: Thought: I need to fetch emails from the Gmail account, specifically from the spam or werbung folder, to identify diaper and dog food offers.
## Using tool: GMAIL_FETCH_EMAILS
## Tool Input: 
"{\"user_id\": \"me\", \"max_results\": 1000, \"include_spam_trash\": true}"
## Tool Output: 
Error: the Action Input is not a valid key, value dictionary.```