I understand your concern! To know what's inside the data object for a specific tool, you need to inspect the tool's output schema. Composio provides several ways to do this:
1. Get the Raw Tool Schema
You can fetch the raw tool definition to see the exact output parameters:
const tool = await composio.tools.getRawComposioToolBySlug('GMAIL_FETCH_EMAILS');
console.log(tool.output_parameters);
This will show you the complete structure of what the tool returns, including all fields and their types [getRawComposioToolBySlug].
2. Check the Tool Documentation
You can also view the tool's schema in the Composio documentation. For example, the Tool Type Generator documentation shows how tool schemas include detailed output_parameters with properties like:
{
"output_parameters": {
"properties": {
"data": {
"description": "Data from the action execution",
"properties": {
"response_data": {
"description": "Full response with details",
"type": "object"
}
}
}
}
}
}
3. Practical Approach
Once you know the schema, you can create a targeted afterExecute modifier: