Skip to main content
Glama

discord_get_audit_log

Fetch Discord server audit logs to track user actions, moderation events, and administrative changes for monitoring and security purposes.

Instructions

Fetch the guild audit log (who did what and when).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
guild_idYes
limitNo1–100, default 25.
action_typeNoOptional: filter by Discord action type ID.

Implementation Reference

  • The handler implementation for discord_get_audit_log, which fetches the audit log from the Discord client.
    case "discord_get_audit_log": {
      const guild = await discord.guilds.fetch(validateId(args.guild_id, "guild_id"));
      const logs = await guild.fetchAuditLogs({
        limit: Math.min(Number(args.limit ?? 25), 100),
        type: args.action_type as number | undefined,
      });
      const result = logs.entries.map((entry) => ({
        id: entry.id, action: entry.action,
        executor: entry.executor?.tag, target: entry.targetId,
        reason: entry.reason, createdAt: entry.createdAt.toISOString(),
      }));
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • The tool definition (schema) for discord_get_audit_log.
    export const definitions = [
      {
        name: "discord_get_audit_log",
        description: "Fetch the guild audit log (who did what and when).",
        inputSchema: {
          type: "object",
          properties: {
            guild_id: { type: "string" },
            limit: { type: "number", description: "1–100, default 25." },
            action_type: { type: "number", description: "Optional: filter by Discord action type ID." },
          },
          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 the full burden of behavioral disclosure. It mentions fetching data but doesn't cover critical aspects like required permissions (e.g., 'VIEW_AUDIT_LOG'), rate limits, pagination behavior, or what the response format looks like. This leaves significant gaps for an agent to understand how to use it safely and effectively.

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 front-loads the core purpose ('Fetch the guild audit log') and adds clarifying context ('who did what and when'). There is no wasted verbiage, making it easy for an agent to parse quickly.

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

Completeness2/5

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

For a tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It lacks details on permissions, rate limits, response structure, and error handling. Given the complexity of audit logs in Discord (which often require specific privileges), this leaves the agent under-informed about how to invoke it correctly.

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

Parameters3/5

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

Schema description coverage is 67% (2 out of 3 parameters have descriptions). The description adds no additional parameter semantics beyond what's in the schema. It doesn't explain 'guild_id' context or elaborate on 'action_type' filtering. With moderate schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate for gaps.

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

Purpose4/5

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

The description clearly states the action ('fetch') and resource ('guild audit log'), with additional context about what the audit log contains ('who did what and when'). It distinguishes itself from siblings by focusing on audit logs rather than other Discord operations like messaging or channel management.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives is provided. While the description implies it's for retrieving audit logs, it doesn't specify prerequisites (e.g., needing admin permissions) or contrast with other audit-related tools like 'discord_audit_permissions'.

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