Skip to content

intelligence_classify_messages

Intelligence Read only

Classify recent messages into provided categories using the client’s LLM. Each classification carries a 0-1 confidence score.

triage spam vs. question vs. discussion; bucket support requests; segment conversations.

{
"name": "intelligence_classify_messages",
"arguments": {
"channel_id": "123456789012345678",
"categories": [
"support",
"spam"
]
}
}
FieldTypeRequiredConstraintsDescription
channel_idstringyespattern: ^\d{17,20}$Channel to classify messages from
categoriesarray<string>yesmin items: 2; max items: 20Category labels (2-20)
limitintegernodefault: 25; min: 5; max: 100Messages to classify (5-100, default 25)
Complete input JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"channel_id": {
"type": "string",
"pattern": "^\\d{17,20}$",
"description": "Channel to classify messages from"
},
"categories": {
"minItems": 2,
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 50
},
"description": "Category labels (2-20)"
},
"limit": {
"default": 25,
"description": "Messages to classify (5-100, default 25)",
"type": "integer",
"minimum": 5,
"maximum": 100
}
},
"required": [
"channel_id",
"categories"
]
}

{classifications:[{message_id, author, category, confidence}], count, sampling_used}.

{
"classifications": [
{
"message_id": "123456789012345678",
"author": "alice",
"category": "support",
"confidence": 0.9
}
],
"count": 1,
"sampling_used": true
}
FieldTypeRequiredConstraintsDescription
classificationsarray<object>no
countnumberno
sampling_usedbooleanno
raw_messagesarray<object>no
categoriesarray<string>no
channel_idstringno
_metaobjectnoPresent 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": {
"classifications": {
"type": "array",
"items": {
"type": "object",
"properties": {
"message_id": {
"type": "string",
"pattern": "^\\d{17,20}$",
"description": "Discord message ID"
},
"author": {
"type": "string"
},
"category": {
"type": "string"
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"message_id",
"author",
"category",
"confidence"
],
"additionalProperties": false
}
},
"count": {
"type": "number"
},
"sampling_used": {
"type": "boolean"
},
"raw_messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"author": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"id",
"author",
"content"
],
"additionalProperties": false
}
},
"categories": {
"type": "array",
"items": {
"type": "string"
}
},
"channel_id": {
"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
}
PropertyValue
Read-onlyyes
Destructiveno
Idempotentyes
Open-worldyes
Confirmation requiredno
  • The intelligence category must be enabled by MCP_CATEGORIES when 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 returns 403; inaccessible resources commonly return 404.

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.

packages/mcp-core/src/tools/intelligence/classify_messages.ts