Let the AI manage inbox channels through tools
Merged
FE
2d ago+598+598+012345678901234567890123456789-47-47-01234567890123456789
The AI chat and MCP clients had no tools for inbox channels. Channels could only be managed from Settings → AI, or through GraphQL by a signed-in user.
What changes
Four tools under a new INBOX_CHANNEL tool category:
| Tool | Access |
|---|---|
list_inbox_channels | AI permission. Returns every channel with isAccessible. Callers who can manage channels also get assignableRoles. |
create_inbox_channel | AI + AI_SETTINGS. Takes a name, an optional icon and color, and the roles it is open to. |
update_inbox_channel | AI + AI_SETTINGS. Changes the name, icon, color, position or roles. Setting roles rewrites conversation grants, as the Settings page does. |
delete_inbox_channel | AI + AI_SETTINGS, destructive. Needs a destination when the channel still has conversations. Standard channels are refused. |
- The tools call
AgentChatChannelService, so validation, grant rewrites and the delete lock match the GraphQL mutations. - The two access policies move out of the resolver into constants that the resolver and the tools share. API keys stay excluded, as they are on the resolver.
- The MCP server instructions and the tool catalog list the new category.
Tests
- New
mcp-inbox-channel-tools.integration-spec.ts:learn_toolsfinds all four tools;- an admin creates, renames, re-roles, deletes and lists a channel;
- a member gets no
assignableRolesand cannot create a channel.
endpoint-permission-declarationssnapshot: added the four tools by hand, from the resolver's entries pluswithAgent. This snapshot and the new spec have not been run locally (no Postgres in my environment), so CI is their first run.tsgo --noEmitandlint:diff-with-mainpass on twenty-server.
Related: a separate PR will let apps ship inbox channels as code (defineInboxChannel).
Generated by Claude Code