New request
#20407: Twenty MCP: draft_email depends on connectedAccountId, but find_connected_accounts returns 0 records for connected Gmail accounts
We'll provision a sandbox, run an agent against the issue, and open a draft PR. You can pull the branch and iterate from there.
Bug Description
When using Twenty MCP to create email drafts, the account discovery flow appears broken.
The MCP exposes a draft_email tool with an optional connectedAccountId field, and a find_connected_accounts tool that appears to be the obvious way to discover those IDs. However, find_connected_accounts returns 0 records, even when Gmail accounts are already connected in the Twenty workspace.
This creates a mismatch between the visible app state and the MCP tool behavior, and makes it difficult or impossible to reliably choose the sending account for email draft creation.
Expected behavior
If Gmail accounts are connected in the workspace, they should be discoverable through the MCP flow used for email drafting.
Expected behavior:
find_connected_accountsreturns the connected Gmail account records and their IDs, ordraft_emailworks reliably without needingconnectedAccountId, using a clear default connected account, or- the correct tool for resolving usable email account IDs is documented and exposed clearly
Technical inputs
- Relevant MCP tools:
draft_emailfind_connected_accounts
draft_emailincludes aconnectedAccountIdfield intended to specify the sending account- Actual result from
find_connected_accounts:{ "success": true, "message": "Found 0 connectedAccount records", "result": { "records": [], "count": "0" }, "recordReferences": [] }
This suggests either: • connected Gmail accounts are not being surfaced through find_connected_accounts, or • find_connected_accounts is not the correct lookup path for draft_email, but that relationship is currently unclear
The MCP find_connected_accounts tool returns zero records, preventing discovery of the connectedAccountId required by draft_email.
- packages/twenty-server/src/engine/core-modules/mcp/tools/draft-email.tool.ts
- packages/twenty-server/src/engine/core-modules/mcp/tools/find-connected-accounts.tool.ts
- packages/twenty-server/src/engine/core-modules/connected-account/services/connected-account.service.ts