discord_copy_permissions
Copy permission overwrites from one Discord channel to another to maintain consistent access controls across channels.
Instructions
Copy all permission overwrites from one channel to another.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_channel_id | Yes | ||
| target_channel_id | Yes | ||
| reason | No |
Implementation Reference
- src/tools/permissions.ts:133-141 (handler)Implementation of the 'discord_copy_permissions' tool handler, which fetches the source and target channels and sets the target's permission overwrites to match the source.
case "discord_copy_permissions": { const source = await getGuildChannel(args.source_channel_id as string); const target = await getGuildChannel(args.target_channel_id as string); const overwrites = source.permissionOverwrites.cache.map((ow) => ({ id: ow.id, type: ow.type, allow: ow.allow, deny: ow.deny, })); await target.permissionOverwrites.set(overwrites, args.reason as string | undefined); return { content: [{ type: "text", text: `✅ Permissions copied from #${source.name} to #${target.name}.` }] }; } - src/tools/permissions.ts:59-70 (schema)Tool definition and schema for 'discord_copy_permissions', specifying required arguments source_channel_id and target_channel_id.
name: "discord_copy_permissions", description: "Copy all permission overwrites from one channel to another.", inputSchema: { type: "object", properties: { source_channel_id: { type: "string" }, target_channel_id: { type: "string" }, reason: { type: "string" }, }, required: ["source_channel_id", "target_channel_id"], }, },