commands_create_global
Create or upsert a global application command. Global commands propagate within ~1 hour.
standard command shape - name is required. description is required for CHAT_INPUT (type=1) but optional for USER (2) / MESSAGE (3) commands.
Idempotent
Section titled “Idempotent”posting the same name+type updates the existing command (Discord upsert semantics).
MCP call example
Section titled “MCP call example”{ "name": "commands_create_global", "arguments": { "application_id": "123456789012345678", "name": "Example name", "type": 1, "description": "Example command description" }}| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
application_id | string | yes | pattern: ^\d{17,20}$ | Bot/app application ID |
name | string | yes | min length: 1; max length: 32 | |
name_localizations | object | null | no | ||
description | string | no | max length: 100 | |
description_localizations | object | null | no | ||
options | array<unknown> | no | ||
default_member_permissions | string | null | no | ||
dm_permission | boolean | null | no | ||
default_permission | boolean | null | no | ||
type | integer | no | min: 1; max: 4 | |
nsfw | boolean | no | ||
integration_types | array<number> | no | ||
contexts | array<number> | no | ||
handler | number | no |
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" }, "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": [ "application_id", "name" ], "$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”{id, name, description, type, application_id}.
Example structured result
Section titled “Example structured result”{ "id": "123456789012345678", "name": "Example name", "type": 1}Output schema
Section titled “Output schema”| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string | yes | ||
application_id | string | no | ||
guild_id | string | null | no | ||
name | string | yes | ||
description | string | no | ||
type | integer | yes |
Complete output JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "id": { "type": "string" }, "application_id": { "type": "string" }, "guild_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "name": { "type": "string" }, "description": { "type": "string" }, "type": { "type": "integer" } }, "required": [ "id", "name", "type" ], "additionalProperties": false}Annotations
Section titled “Annotations”| Property | Value |
|---|---|
| Read-only | no |
| Destructive | no |
| Idempotent | yes |
| Open-world | yes |
| Confirmation required | no |
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/create_global.ts