Skip to main content
Glama
discord-mcp

discord-mcp

audit_log_get

Read-onlyIdempotent

Fetch Discord guild audit log entries to investigate moderation actions such as member kicks, with filters and pagination.

Instructions

Purpose: Fetch audit log entries for a guild.

When to use: investigate "who kicked X?", post-incident forensics.

Example: {guild_id:"999000999000999000", limit:50, action_type:20} (action_type 20 = MEMBER_KICK)

Pagination: pass before as the last entry's oldest_id to fetch older entries. Discord returns entries in descending ID order; repeat until a page is empty.

Returns: {entries:[{id, target_id, user_id, action_type, reason}], count, oldest_id?}. Structured reason values remain raw moderator-controlled data; the human-readable text response fences them.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "guild_id": "<guild_id>"
    },
    "name": "audit_log_get"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax entries (1-100, default 50)
beforeNoReturn entries with ID less than this entry ID
user_idNoFilter to entries triggered by this user
guild_idYesGuild to query
action_typeNoFilter by Discord audit action type

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.28.0
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "$schema": "https://json-schema.org/draft/2020-12/schema",
      -    "additionalProperties": {},
      -    "properties": {
      -      "count": {
      -        "type": "number"
      -      },
      -      "entries": {
      -        "items": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "action_type": {
      -              "maximum": 9007199254740991,
      -              "minimum": -9007199254740991,
      -              "type": "integer"
      -            },
      -            "id": {
      -              "type": "string"
      -            },
      -            "reason": {
      -              "type": "string"
      -            },
      -            "target_id": {
      -              "anyOf": [
      -                {
      -                  "type": "string"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ]
      -            },
      -            "user_id": {
      -              "anyOf": [
      -                {
      -                  "description": "Discord user ID",
      -                  "pattern": "^\\d{17,20}$",
      -                  "type": "string"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ]
      -            }
      -          },
      -          "required": [
      -            "id",
      -            "target_id",
      -            "user_id",
      -            "action_type"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      },
      -      "oldest_id": {
      -        "description": "Oldest entry ID; pass as before for the next page",
      -        "pattern": "^\\d{17,20}$",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "entries",
      -      "count"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "category": {
      -        "enum": [
      -          "client",
      -          "server"
      -        ],
      -        "type": "string"
      -      },
      -      "code": {
      -        "type": "string"
      -      },
      -      "recovery_hint": {
      -        "type": "string"
      -      },
      -      "retriable": {
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "code",
      -      "retriable",
      -      "category",
      -      "recovery_hint"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "$schema": "https://json-schema.org/draft/2020-12/schema",
      +    "additionalProperties": {},
      +    "properties": {
      +      "count": {
      +        "type": "number"
      +      },
      +      "entries": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "action_type": {
      +              "maximum": 9007199254740991,
      +              "minimum": -9007199254740991,
      +              "type": "integer"
      +            },
      +            "id": {
      +              "type": "string"
      +            },
      +            "reason": {
      +              "type": "string"
      +            },
      +            "target_id": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "user_id": {
      +              "anyOf": [
      +                {
      +                  "description": "Discord user ID",
      +                  "pattern": "^\\d{17,20}$",
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            }
      +          },
      +          "required": [
      +            "id",
      +            "target_id",
      +            "user_id",
      +            "action_type"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "oldest_id": {
      +        "description": "Oldest entry ID; pass as before for the next page",
      +        "pattern": "^\\d{17,20}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "entries",
      +      "count"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "category": {
      +        "enum": [
      +          "client",
      +          "server"
      +        ],
      +        "type": "string"
      +      },
      +      "code": {
      +        "type": "string"
      +      },
      +      "recovery_hint": {
      +        "type": "string"
      +      },
      +      "retriable": {
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "code",
      +      "retriable",
      +      "category",
      +      "recovery_hint"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed2 schema fields changedv0.26.0
    • addedInput schema / properties / before
      Added value: +{
      +  "description": "Return entries with ID less than this entry ID",
      +  "pattern": "^\\d{17,20}$",
      +  "type": "string"
      +}
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "$schema": "https://json-schema.org/draft/2020-12/schema",
      -    "additionalProperties": {},
      -    "properties": {
      -      "count": {
      -        "type": "number"
      -      },
      -      "entries": {
      -        "items": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "action_type": {
      -              "maximum": 9007199254740991,
      -              "minimum": -9007199254740991,
      -              "type": "integer"
      -            },
      -            "id": {
      -              "type": "string"
      -            },
      -            "reason": {
      -              "type": "string"
      -            },
      -            "target_id": {
      -              "anyOf": [
      -                {
      -                  "type": "string"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ]
      -            },
      -            "user_id": {
      -              "anyOf": [
      -                {
      -                  "description": "Discord user ID",
      -                  "pattern": "^\\d{17,20}$",
      -                  "type": "string"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ]
      -            }
      -          },
      -          "required": [
      -            "id",
      -            "target_id",
      -            "user_id",
      -            "action_type"
      -          ],
      -          "type": "object"
      -        },
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "entries",
      -      "count"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "category": {
      -        "enum": [
      -          "client",
      -          "server"
      -        ],
      -        "type": "string"
      -      },
      -      "code": {
      -        "type": "string"
      -      },
      -      "recovery_hint": {
      -        "type": "string"
      -      },
      -      "retriable": {
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "code",
      -      "retriable",
      -      "category",
      -      "recovery_hint"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "$schema": "https://json-schema.org/draft/2020-12/schema",
      +    "additionalProperties": {},
      +    "properties": {
      +      "count": {
      +        "type": "number"
      +      },
      +      "entries": {
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "action_type": {
      +              "maximum": 9007199254740991,
      +              "minimum": -9007199254740991,
      +              "type": "integer"
      +            },
      +            "id": {
      +              "type": "string"
      +            },
      +            "reason": {
      +              "type": "string"
      +            },
      +            "target_id": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "user_id": {
      +              "anyOf": [
      +                {
      +                  "description": "Discord user ID",
      +                  "pattern": "^\\d{17,20}$",
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            }
      +          },
      +          "required": [
      +            "id",
      +            "target_id",
      +            "user_id",
      +            "action_type"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "oldest_id": {
      +        "description": "Oldest entry ID; pass as before for the next page",
      +        "pattern": "^\\d{17,20}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "entries",
      +      "count"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "category": {
      +        "enum": [
      +          "client",
      +          "server"
      +        ],
      +        "type": "string"
      +      },
      +      "code": {
      +        "type": "string"
      +      },
      +      "recovery_hint": {
      +        "type": "string"
      +      },
      +      "retriable": {
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "code",
      +      "retriable",
      +      "category",
      +      "recovery_hint"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. First observedv0.22.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds genuinely new behavioral context: descending ID ordering, the 'repeat until a page is empty' termination rule, and — most valuably — a warning that moderator-controlled `reason` values are raw data fenced in the text response. That is a real safety disclosure no annotation carries.

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?

Labeled sections (Purpose / When to use / Example / Pagination / Returns) make it easy to skim and front-load the intent. Every sentence carries operational value — the example, the pagination rule, and the injection caveat all change how an agent calls it.

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

Completeness5/5

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

For a filtered, paginated read tool this covers everything needed: intent, a worked example, pagination termination, filtering semantics, and output shape. The presence of an output schema is reinforced rather than duplicated, and the untrusted-data caveat closes the remaining gap.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema lacks: the example shows a concrete call shape and decodes `action_type:20` as MEMBER_KICK, and it clarifies that `before` takes the previous page's `oldest_id` rather than an arbitrary ID.

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?

States a specific verb and resource ('Fetch audit log entries for a guild') with clear scope, and the framing (forensics, moderation incidents) distinguishes it from sibling read tools like members_get_ban or guild_get, which return different resources.

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

Usage Guidelines4/5

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

Gives explicit when-to-use triggers ('who kicked X?', post-incident forensics) that map cleanly onto the audit-log resource. It does not name an alternative tool or state exclusions, which keeps it from a 5, but the positive guidance is unambiguous.

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

Deploy Server

Other Tools