[Bug]: GMAIL_FETCH_EMAILS returns empty messages
SDK Language
TypeScript / Node.js SDK (@composio/core)
SDK Version
0.2.3
Runtime Environment
Node.js v22
Environment
Production Deployment
Describe the Bug
The GMAIL_FETCH_EMAILS action consistently returns an empty messages array despite:
- Returning
successful: true - Having a valid
resultSizeEstimate(e.g., 201 emails) - Providing a valid
nextPageToken
Expected Behavior: Should return an array of email messages matching the query parameters.
Actual Behavior: Returns empty array messages: [] while indicating success.
Steps to Reproduce
- Set up Gmail integration with Composio
- Create a connected account with Gmail OAuth
- Execute
GMAIL_FETCH_EMAILSwith entity ID and parameters - Observe empty messages array despite existing emails
Minimal Reproducible Example
curl -X POST "https://backend.composio.dev/api/v3/tools/execute/GMAIL_FETCH_EMAILS" \
-H "Content-Type: application/json" \
-H "X-API-Key: <COMPOSIO_API_KEY>" \
-d '{
"user_id": "<USER_ID>",
"arguments": {
"label_ids": ["UNREAD"],
"max_results": 10
}
}'
Error Output / Stack Trace
no errors, returns empty array as response
Reproducibility
- [x] Always reproducible
- [ ] Intermittent / Sometimes
- [ ] Happened once, can’t reproduce
Additional Context or Screenshots
No response
Seems like the issue gets resolved when setting verbose to false when calling the tool, i.e.
{
"max_results": 10,
"verbose": false
}
So the issue is with the verbose: true mode, which is also the default
Hey @a9a4k, could you share more details about this snippet:
const result = await tools.GMAIL_FETCH_EMAILS.execute({
context: {
label_ids: ['UNREAD'],
max_results: 10
}
});
Doc to refer: https://docs.composio.dev/docs/executing-tools#direct-tool-execution
Hi @Uday-sidagana , ye, apologies for the confusion, I updated to curl command. I asked LLM to create typescript snippet out of it when creating ticket, but seems like it didn't quite get it. This snippet reproduces the issue
curl -X POST "https://backend.composio.dev/api/v3/tools/execute/GMAIL_FETCH_EMAILS" \
-H "Content-Type: application/json" \
-H "X-API-Key: <COMPOSIO_API_KEY>" \
-d '{
"user_id": "<USER_ID>",
"arguments": {
"label_ids": ["UNREAD"],
"max_results": 10
}
}'
Got it @a9a4k, the CUrl request you’ve shared works fine on our end. Could you share the exact response payload, including the logId or requestId?
Sure, here is the response
{"data":{"messages":[],"nextPageToken":"12044410112852341612","resultSizeEstimate":201},"successful":true,"error":null,"log_id":"log_KnFsz_vX7N_L"}
I think I might have misconfigure the Google Client, so closing the issue