Skip to main content
Glama

discord_audit_permissions

Generate a permission audit report to identify who can access each channel in a Discord guild, ensuring proper access control.

Instructions

Generate a full permission audit report for a guild: who can access what on every channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guild_idYes

Implementation Reference

  • The implementation of the 'discord_audit_permissions' tool handler, which fetches guild data and generates a permission overwrite report.
    case "discord_audit_permissions": {
      const guild = await discord.guilds.fetch(validateId(args.guild_id, "guild_id"));
      await guild.channels.fetch();
      await guild.roles.fetch();
      const memberIdsNeeded = new Set<string>();
      guild.channels.cache.forEach((ch) => {
        if (ch instanceof GuildChannel) {
          ch.permissionOverwrites.cache.forEach((ow) => {
            if (ow.type === 1) memberIdsNeeded.add(ow.id);
          });
        }
      });
      await Promise.all([...memberIdsNeeded].map((id) => guild.members.fetch(id).catch(() => null)));
      const report: Record<string, unknown>[] = [];
      guild.channels.cache
        .filter((c) => c instanceof GuildChannel)
        .forEach((ch) => {
          const gch = ch as GuildChannel;
          const overwrites = gch.permissionOverwrites.cache.map((ow) => {
            const isRole = ow.type === 0;
            const entity = isRole
              ? guild.roles.cache.get(ow.id)?.name ?? ow.id
              : guild.members.cache.get(ow.id)?.user.tag ?? ow.id;
            return { entity, type: isRole ? "role" : "member", allow: serializePermissions(ow.allow), deny: serializePermissions(ow.deny) };
          });
          if (overwrites.length > 0) report.push({ channel: gch.name, channelId: gch.id, overwrites });
        });
      return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] };
    }
  • The schema definition for the 'discord_audit_permissions' tool.
      name: "discord_audit_permissions",
      description: "Generate a full permission audit report for a guild: who can access what on every channel.",
      inputSchema: {
        type: "object",
        properties: { guild_id: { type: "string" } },
        required: ["guild_id"],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but reveals little beyond the basic operation. It doesn't disclose whether this requires admin permissions, how long it takes for large guilds, what format the report takes, or if it's a read-only operation (though 'audit' implies non-destructive). Critical behavioral traits are missing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that immediately conveys the core purpose without any wasted words. It's perfectly front-loaded with the main action and scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and minimal parameter documentation, the description provides adequate basic purpose but lacks crucial details about behavioral characteristics, output format, and usage context. It's minimally viable but leaves significant gaps for an audit operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only one parameter (guild_id) and 0% schema description coverage, the description compensates by clarifying that the parameter is for the guild being audited. While it doesn't specify format requirements (e.g., numeric ID vs name), it provides essential context that the schema alone lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Generate a full permission audit report') and target resource ('for a guild'), with precise scope ('who can access what on every channel'). It effectively distinguishes this tool from siblings like discord_get_channel_permissions (single channel) or discord_list_channels (simple listing).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when a comprehensive guild-wide permission analysis is needed, but provides no explicit guidance on when to use this versus alternatives like discord_get_channel_permissions (for single channels) or discord_get_audit_log (for historical actions). No prerequisites or exclusions are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PaSympa/discord-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server