Fredrik
01/21/2026, 10:25 AMcomposio.create(user_id="<user_X_id>", connected_accounts={"gmail": "<connected_account_id_for_gmail_and_user_x>"}) which means Composio tool router will decide which tool(s) to call on behalf of user X.
* Will Composio tool router be aware that the <connected_account_id_for_gmail_and_user_x was not created with enough scopes to use the send email tool, or how does the tool router work here?aeve
01/21/2026, 10:29 AMAbhishek
01/21/2026, 1:51 PMimport { Composio, CustomAuthParamsSchema } from "@composio/core";
const composio = new Composio({
apiKey: "ak_.."
});
const res = await composio.tools.getRawComposioToolBySlug("GMAIL_SEND_EMAIL")
console.log(res.scopes);Fredrik
01/21/2026, 2:50 PM- https://mail.google.com/
- https://www.googleapis.com/auth/gmail.modify
- https://www.googleapis.com/auth/gmail.compose
- https://www.googleapis.com/auth/gmail.send
This is way more than required to send an email. Google's docs [says this](https://developers.google.com/workspace/gmail/api/auth/scopes) on the https://mail.google.com/ scope:
> Full access to the account's mailboxes, including permanent deletion of threads and messages This scope should only be requested if your application needs to immediately and permanently delete threads and messages, bypassing Trash; all other actions can be performed with less permissive scopes.
I understand that the job to curate the list of required scopes for each tool (in your case - many) is a lot of work, but at the same time your users need to be able to trust Tool Router not rejecting calling tools like GMAIL_SEND_EMAIL due to lack of full Gmail accessdhawal
01/21/2026, 4:51 PMdhawal
01/21/2026, 4:59 PMFredrik
01/21/2026, 5:00 PMFredrik
01/21/2026, 5:25 PMcomposio.create(user_id="<customer_id>", connected_accounts={"<toolkit>": "<connected_account_id>", ...}) OR @dhawal could we use composio.tool_router.create(user_id="<customer_id", toolkits=['<toolkit>, ...], tools={<toolkit>: "<whitelisted_tools>"}, ...)
* Pros:
* Whitelisting auth configs is minimal work for us
* Outsourcing the tool calling strategy decreases work for us
* Cons:
* If Composio's tool router calls tools that the user hasn't given access to it's a dealbreaker for us
* If we have to whitelist tools, it's better than the con above, but still a lot of work for us
I hope this clarifies things for youAbhishek
01/22/2026, 7:43 AMFredrik
01/27/2026, 6:07 PM