intelligence_moderate_content
Apply a plain-language moderation policy to a piece of text using the client’s LLM. No Discord API call - purely a moderation utility.
When to use
Section titled “When to use”pre-check user-submitted content; second-opinion on AutoMod decisions; classify ambiguous messages.
MCP call example
Section titled “MCP call example”{ "name": "intelligence_moderate_content", "arguments": { "content": "Hello from discord-mcp" }}| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
content | string | yes | min length: 1; max length: 4000 | Text to moderate |
policy | string | no | default: "Reject hate speech, doxxing, spam, and explicit content."; min length: 10; max length: 2000 | Moderation policy in plain language |
Complete input JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "content": { "type": "string", "minLength": 1, "maxLength": 4000, "description": "Text to moderate" }, "policy": { "default": "Reject hate speech, doxxing, spam, and explicit content.", "description": "Moderation policy in plain language", "type": "string", "minLength": 10, "maxLength": 2000 } }, "required": [ "content" ]}Returns
Section titled “Returns”{decision: "allow"|"flag"|"block", reasons[], confidence, sampling_used}.
Example structured result
Section titled “Example structured result”{ "decision": "allow", "reasons": [], "confidence": 0.95, "sampling_used": true}Output schema
Section titled “Output schema”| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
decision | ”allow” | “flag” | “block” | no | one of allow, flag, block | |
reasons | array<string> | no | ||
confidence | number | no | min: 0; max: 1 | |
sampling_used | boolean | no | ||
content | string | no | ||
policy | string | no | ||
_meta | object | no | Present ONLY when the client lacks the sampling capability. When present, the analysed fields are absent and the raw Discord payload is returned instead for the host model to process. |
Complete output JSON Schema
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "decision": { "type": "string", "enum": [ "allow", "flag", "block" ] }, "reasons": { "type": "array", "items": { "type": "string" } }, "confidence": { "type": "number", "minimum": 0, "maximum": 1 }, "sampling_used": { "type": "boolean" }, "content": { "type": "string" }, "policy": { "type": "string" }, "_meta": { "description": "Present ONLY when the client lacks the sampling capability. When present, the analysed fields are absent and the raw Discord payload is returned instead for the host model to process.", "type": "object", "properties": { "fallback": { "type": "string", "const": "host_llm_should_process" }, "intent": { "type": "string" }, "sampling_used": { "type": "boolean", "const": false } }, "required": [ "fallback", "intent", "sampling_used" ], "additionalProperties": false } }, "additionalProperties": false}Annotations
Section titled “Annotations”| Property | Value |
|---|---|
| Read-only | yes |
| Destructive | no |
| Idempotent | yes |
| Open-world | yes |
| Confirmation required | no |
Access and common errors
Section titled “Access and common errors”- The
intelligencecategory 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/intelligence/moderate_content.ts