Skip to main content
Glama
discord-mcp

discord-mcp

templates_diff

Read-onlyIdempotent

Detect channel and role drift between a Guild Template snapshot and its source guild before sync; review mismatches without making changes.

Instructions

Purpose: Detect channel and role drift between a Guild Template snapshot and its source guild before templates_sync.

Safety: The source guild ID must match guild_id; otherwise the tool refuses to read that guild. Raw names are returned only in fenced untrusted_text. It also compares matched-role permission bitfields, matched-channel settings present in both payloads, and mappable permission overwrites. Discord-managed bot/integration roles are excluded because Guild Templates do not serialize them. Discord News and Stage channels are reported separately when the official snapshot cannot represent them. Missing optional fields or unmapped overwrite subjects require manual review rather than a false claim of equality.

Returns: {template, source_guild_matches, drift, untrusted_text}. This tool is read-only and never syncs the template.

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>",
      "template_code": "<template_code>"
    },
    "name": "templates_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
guild_idYesGuild expected to be the template source guild
template_codeYesGuild Template code to compare

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": {
      -      "drift": {
      -        "anyOf": [
      -          {
      -            "additionalProperties": false,
      -            "properties": {
      -              "channel_setting_difference_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "channels_added_since_snapshot_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "channels_missing_from_guild_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "channels_not_representable_in_template_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "permission_overwrite_difference_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "role_permission_difference_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "roles_added_since_snapshot_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "roles_missing_from_guild_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "source_guild_channel_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "source_guild_role_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "sync_recommended": {
      -                "type": "boolean"
      -              },
      -              "template_channel_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "template_marked_dirty": {
      -                "anyOf": [
      -                  {
      -                    "type": "boolean"
      -                  },
      -                  {
      -                    "type": "null"
      -                  }
      -                ]
      -              },
      -              "template_role_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              },
      -              "unmapped_permission_overwrite_count": {
      -                "maximum": 9007199254740991,
      -                "minimum": 0,
      -                "type": "integer"
      -              }
      -            },
      -            "required": [
      -              "template_channel_count",
      -              "source_guild_channel_count",
      -              "channels_missing_from_guild_count",
      -              "channels_added_since_snapshot_count",
      -              "channels_not_representable_in_template_count",
      -              "template_role_count",
      -              "source_guild_role_count",
      -              "roles_missing_from_guild_count",
      -              "roles_added_since_snapshot_count",
      -              "role_permission_difference_count",
      -              "channel_setting_difference_count",
      -              "permission_overwrite_difference_count",
      -              "unmapped_permission_overwrite_count",
      -              "template_marked_dirty",
      -              "sync_recommended"
      -            ],
      -            "type": "object"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ]
      -      },
      -      "source_guild_matches": {
      -        "type": "boolean"
      -      },
      -      "template": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "code": {
      -            "maxLength": 100,
      -            "minLength": 1,
      -            "pattern": "^[a-zA-Z0-9_-]+$",
      -            "type": "string"
      -          },
      -          "created_at": {
      -            "type": "string"
      -          },
      -          "creator_id": {
      -            "description": "Discord user ID",
      -            "pattern": "^\\d{17,20}$",
      -            "type": "string"
      -          },
      -          "description": {
      -            "anyOf": [
      -              {
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ]
      -          },
      -          "is_dirty": {
      -            "anyOf": [
      -              {
      -                "type": "boolean"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ]
      -          },
      -          "name": {
      -            "type": "string"
      -          },
      -          "source_guild_id": {
      -            "description": "Discord guild (server) ID",
      -            "pattern": "^\\d{17,20}$",
      -            "type": "string"
      -          },
      -          "updated_at": {
      -            "type": "string"
      -          },
      -          "usage_count": {
      -            "maximum": 9007199254740991,
      -            "minimum": 0,
      -            "type": "integer"
      -          },
      -          "use_url": {
      -            "format": "uri",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "code",
      -          "name",
      -          "description",
      -          "usage_count",
      -          "creator_id",
      -          "created_at",
      -          "updated_at",
      -          "source_guild_id",
      -          "is_dirty",
      -          "use_url"
      -        ],
      -        "type": "object"
      -      },
      -      "untrusted_text": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "template",
      -      "source_guild_matches",
      -      "drift",
      -      "untrusted_text"
      -    ],
      -    "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": {
      +      "drift": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "channel_setting_difference_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "channels_added_since_snapshot_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "channels_missing_from_guild_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "channels_not_representable_in_template_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "permission_overwrite_difference_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "role_permission_difference_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "roles_added_since_snapshot_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "roles_missing_from_guild_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "source_guild_channel_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "source_guild_role_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "sync_recommended": {
      +                "type": "boolean"
      +              },
      +              "template_channel_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "template_marked_dirty": {
      +                "type": [
      +                  "boolean",
      +                  "null"
      +                ]
      +              },
      +              "template_role_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "unmapped_permission_overwrite_count": {
      +                "maximum": 9007199254740991,
      +                "minimum": 0,
      +                "type": "integer"
      +              }
      +            },
      +            "required": [
      +              "template_channel_count",
      +              "source_guild_channel_count",
      +              "channels_missing_from_guild_count",
      +              "channels_added_since_snapshot_count",
      +              "channels_not_representable_in_template_count",
      +              "template_role_count",
      +              "source_guild_role_count",
      +              "roles_missing_from_guild_count",
      +              "roles_added_since_snapshot_count",
      +              "role_permission_difference_count",
      +              "channel_setting_difference_count",
      +              "permission_overwrite_difference_count",
      +              "unmapped_permission_overwrite_count",
      +              "template_marked_dirty",
      +              "sync_recommended"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "source_guild_matches": {
      +        "type": "boolean"
      +      },
      +      "template": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "maxLength": 100,
      +            "minLength": 1,
      +            "pattern": "^[a-zA-Z0-9_-]+$",
      +            "type": "string"
      +          },
      +          "created_at": {
      +            "type": "string"
      +          },
      +          "creator_id": {
      +            "description": "Discord user ID",
      +            "pattern": "^\\d{17,20}$",
      +            "type": "string"
      +          },
      +          "description": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "is_dirty": {
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "source_guild_id": {
      +            "description": "Discord guild (server) ID",
      +            "pattern": "^\\d{17,20}$",
      +            "type": "string"
      +          },
      +          "updated_at": {
      +            "type": "string"
      +          },
      +          "usage_count": {
      +            "maximum": 9007199254740991,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "use_url": {
      +            "format": "uri",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "name",
      +          "description",
      +          "usage_count",
      +          "creator_id",
      +          "created_at",
      +          "updated_at",
      +          "source_guild_id",
      +          "is_dirty",
      +          "use_url"
      +        ],
      +        "type": "object"
      +      },
      +      "untrusted_text": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "template",
      +      "source_guild_matches",
      +      "drift",
      +      "untrusted_text"
      +    ],
      +    "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. First observedv0.22.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the guild-ID match guard, that raw names are only surfaced in fenced `untrusted_text` (a prompt-injection safeguard), that matched-role permission bitfields and channel settings are compared, and that Discord-managed bot roles and News/Stage channels are handled specially. The read-only claim is consistent with `readOnlyHint: true` and adds the explicit "never syncs" guarantee.

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

Conciseness4/5

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

Front-loaded Purpose/Safety/Returns labels make it scannable and every claim is substantive. The closing sentence restates the read-only annotation, which is the only mildly redundant element.

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?

Although an output schema exists, the description still names the top-level return keys and explains how partial or unmappable data is reported instead of asserting false equality. For a comparison tool with realistic edge cases, nothing an agent needs in order to interpret a result correctly is missing.

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 baseline is 3, but the description adds real meaning: `guild_id` is not merely a guild but the guild expected to be the template source, and a mismatch causes a refusal rather than an error or empty result. `template_code` semantics are left to the schema.

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 ("detect") and resource ("channel and role drift between a Guild Template snapshot and its source guild"), and positions itself relative to `templates_sync` as a pre-check. An agent can distinguish this from `templates_get` or `templates_inspect` without opening a schema.

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?

The phrase "before `templates_sync`" gives a clear sequencing rule, and the manual-review caveat tells the agent what to do when fields are missing. It does not explicitly exclude the sibling inspection tools or state prerequisites such as permissions, so it falls short of a full when/when-not map.

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