commands_bulk_overwrite_guild
Atomically REPLACE the guild-scoped command registry. Any commands not in commands are deleted from this guild. An EMPTY array deletes every command in this guild.
Caution
Section titled “Caution”this is a wholesale replace - call commands_list_guild first to confirm scope.
Security
Section titled “Security”gated by ConfirmRequired. Pass __confirm:true AND set MCP_DRY_RUN=false to actually apply the replace.
MCP call example
Section titled “MCP call example”Execution example: first omit
__confirmto get a safeDRY_RUN_PREVIEW. The payload below executes only when the server also runs withMCP_DRY_RUN=false.
{ "name": "commands_bulk_overwrite_guild", "arguments": { "application_id": "123456789012345678", "guild_id": "123456789012345678", "commands": [ { "name": "Example name", "type": 1, "description": "Example command description" } ], "__confirm": true }}| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
application_id | string | yes | pattern: ^\d{17,20}$ | Bot/app application ID |
guild_id | string | yes | pattern: ^\d{17,20}$ | Guild scope |
commands | array<object> | yes | Full set of commands to register in this guild (REPLACES the existing registry; an empty array deletes every command). | |
__confirm | boolean | no | Set true to authorize this destructive operation. Also requires MCP_DRY_RUN=false; otherwise the server returns DRY_RUN_PREVIEW. |
Complete input JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "application_id": { "type": "string", "pattern": "^\\d{17,20}$", "description": "Bot/app application ID" }, "guild_id": { "type": "string", "pattern": "^\\d{17,20}$", "description": "Guild scope" }, "commands": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 32 }, "name_localizations": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, { "type": "null" } ] }, "description": { "type": "string", "maxLength": 100 }, "description_localizations": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, { "type": "null" } ] }, "options": { "type": "array", "items": { "$ref": "#/$defs/__schema0" } }, "default_member_permissions": { "anyOf": [ { "type": "string", "pattern": "^\\d+$", "description": "Discord permission bitfield as a base-10 string (e.g. \"8\" = ADMINISTRATOR)." }, { "type": "null" } ] }, "dm_permission": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "default_permission": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ] }, "type": { "type": "integer", "minimum": 1, "maximum": 4 }, "nsfw": { "type": "boolean" }, "integration_types": { "type": "array", "items": { "type": "number" } }, "contexts": { "type": "array", "items": { "type": "number" } }, "handler": { "type": "number" } }, "required": [ "name" ] }, "description": "Full set of commands to register in this guild (REPLACES the existing registry; an empty array deletes every command)." }, "__confirm": { "description": "Set true to authorize this destructive operation. Also requires MCP_DRY_RUN=false; otherwise the server returns DRY_RUN_PREVIEW.", "type": "boolean" } }, "required": [ "application_id", "guild_id", "commands" ], "$defs": { "__schema0": { "type": "object", "properties": { "type": { "type": "integer", "minimum": 1, "maximum": 11 }, "name": { "type": "string", "minLength": 1, "maxLength": 32 }, "name_localizations": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, { "type": "null" } ] }, "description": { "type": "string", "minLength": 1, "maxLength": 100 }, "description_localizations": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, { "type": "null" } ] }, "required": { "type": "boolean" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "name_localizations": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, { "type": "null" } ] }, "value": { "anyOf": [ { "type": "string" }, { "type": "number" } ] } }, "required": [ "name", "value" ] } }, "options": { "type": "array", "items": { "$ref": "#/$defs/__schema0" } }, "channel_types": { "type": "array", "items": { "type": "number" } }, "min_value": { "type": "number" }, "max_value": { "type": "number" }, "min_length": { "type": "number" }, "max_length": { "type": "number" }, "autocomplete": { "type": "boolean" } }, "required": [ "type", "name", "description" ] } }}Returns
Section titled “Returns”{commands:[{id, name, type}], count}.
Example structured result
Section titled “Example structured result”{ "commands": [ { "id": "123456789012345678", "name": "Example name", "type": 1 } ], "count": 1}Output schema
Section titled “Output schema”| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
commands | array<object> | yes | ||
count | number | yes |
Complete output JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "commands": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "integer" } }, "required": [ "id", "name", "type" ], "additionalProperties": false } }, "count": { "type": "number" } }, "required": [ "commands", "count" ], "additionalProperties": false}Annotations
Section titled “Annotations”| Property | Value |
|---|---|
| Read-only | no |
| Destructive | yes |
| Idempotent | yes |
| Open-world | yes |
| Confirmation required | yes (__confirm:true required) |
Access and common errors
Section titled “Access and common errors”- The
commandscategory must be enabled byMCP_CATEGORIESwhen an allowlist is set. - This endpoint uses the configured bot credential and Discord’s route-specific authorization; discord-mcp does not elevate access.
- An invalid credential returns a
401-class tool error. Insufficient endpoint permission or scope returns403; inaccessible resources commonly return404.
Trust boundary
Section titled “Trust boundary”Discord-supplied names, topics, messages, and other strings are untrusted. Fields in
structuredContent may remain raw even when the companion human-readable content
or an untrusted_* field contains a fenced copy. Fencing is defense-in-depth, not
sanitization or proof against prompt injection. Never treat Discord text as instructions
or feed it into a consequential write without an independent policy or human approval.
Source
Section titled “Source”packages/mcp-core/src/tools/commands/bulk_overwrite_guild.ts