Search Messages
Immutable Catalog + Curated Guide
This lossless descriptor comes from the active Portal catalog and is enhanced with reviewed examples.
- Contract tier:
agent_ready - Risk:
read - Catalog version:
discord-2026.07.12.3 - Descriptor hash:
66e7ff3831cc41079c28f1834472ab3292b56e3d4169cfe44f4b3925e3aa829f
Find messages by query, author, and date ranges.
Request Body
{
"jsonrpc": "2.0",
"id": "discord-search-messages-example",
"method": "tools/call",
"params": {
"name": "discord.search_messages",
"arguments": {
"channel_id": "123456789",
"query": "billing",
"date_from": "2026-03-01",
"date_to": "2026-03-29"
}
}
}
Arguments Schema
{
"type": "object",
"title": "search_messages input",
"properties": {
"limit": {
"type": "string",
"title": "Limit",
"default": "",
"description": "Maximum records or matches, expressed as a positive decimal string unless typed as integer."
},
"query": {
"type": "string",
"title": "Query",
"default": "",
"description": "Punctuation-normalized multi-token search text; all terms must match."
},
"date_to": {
"type": "string",
"title": "Date To",
"default": "",
"description": "Optional inclusive upper date/time bound for message search."
},
"has_file": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
],
"title": "Has File",
"default": false,
"description": "When true, restrict search to messages with an attachment."
},
"has_link": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
],
"title": "Has Link",
"default": false,
"description": "When true, restrict search to messages containing an HTTP(S) link."
},
"author_id": {
"type": "string",
"title": "Author Id",
"default": "",
"description": "Optional Discord user snowflake used to filter message authors."
},
"date_from": {
"type": "string",
"title": "Date From",
"default": "",
"description": "Optional inclusive lower date/time bound for message search."
},
"channel_id": {
"type": "string",
"title": "Channel Id",
"default": "",
"description": "Discord channel snowflake; empty uses the primary channel only where documented."
},
"include_threads": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
],
"title": "Include Threads",
"default": false,
"description": "When true, include eligible thread messages."
},
"after_message_id": {
"type": "string",
"title": "After Message Id",
"default": "",
"description": "Optional Discord message snowflake; return records created after it."
},
"before_message_id": {
"type": "string",
"title": "Before Message Id",
"default": "",
"description": "Optional Discord message snowflake; return records created before it."
}
},
"description": "Validated input for the Discord MCP search_messages tool."
}
Output Schema
{
"oneOf": [
{
"type": "object",
"required": [
"ok",
"data",
"meta"
],
"properties": {
"ok": {
"const": true
},
"data": {
"type": "object",
"properties": {
"count": {
"type": [
"integer",
"null"
],
"description": "Provider data field count returned by search_messages."
},
"limit": {
"type": [
"integer",
"null"
],
"description": "Provider data field limit returned by search_messages."
},
"filters": {
"type": [
"object",
"null"
],
"description": "Provider data field filters returned by search_messages.",
"additionalProperties": true
},
"messages": {
"type": "array",
"items": {},
"description": "Provider data field messages returned by search_messages."
},
"channel_id": {
"type": [
"string",
"null"
],
"description": "Provider data field channel_id returned by search_messages."
}
},
"description": "matching messages, applied filters, counts, and pagination context",
"additionalProperties": true
},
"meta": {
"type": "object",
"required": [
"duration_ms",
"rate_limit",
"warnings"
],
"properties": {
"guild_id": {
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
},
"thread_id": {
"type": "string"
},
"channel_id": {
"type": "string"
},
"rate_limit": {
"type": "object",
"additionalProperties": true
},
"request_id": {
"type": "string"
},
"duration_ms": {
"type": "integer",
"minimum": 0
}
},
"description": "Safe execution metadata containing no credentials or raw headers.",
"additionalProperties": true
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"ok",
"error",
"meta"
],
"properties": {
"ok": {
"const": false
},
"meta": {
"type": "object",
"required": [
"duration_ms",
"rate_limit",
"warnings"
],
"properties": {
"guild_id": {
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
},
"thread_id": {
"type": "string"
},
"channel_id": {
"type": "string"
},
"rate_limit": {
"type": "object",
"additionalProperties": true
},
"request_id": {
"type": "string"
},
"duration_ms": {
"type": "integer",
"minimum": 0
}
},
"description": "Safe execution metadata containing no credentials or raw headers.",
"additionalProperties": true
},
"error": {
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"type": {
"type": "string"
},
"message": {
"type": "string"
},
"diagnostics": {
"type": "object",
"additionalProperties": true
},
"required_perms": {
"type": "array",
"items": {
"type": "string"
}
},
"discord_error_code": {
"type": "integer"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
],
"title": "Discord MCP provider result",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Normalized success or semantic-error response; ok=false is a failed call."
}
Code Examples
- cURL
- Node.js
- Python
curl -X POST 'https://portal.madpanda3d.com/api/mcp' \
-H 'Authorization: Bearer mad_live_***' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": "discord-search-messages-example",
"method": "tools/call",
"params": {
"name": "discord.search_messages",
"arguments": {
"channel_id": "123456789",
"query": "billing",
"date_from": "2026-03-01",
"date_to": "2026-03-29"
}
}
}'
const response = await fetch('https://portal.madpanda3d.com/api/mcp', {
method: 'POST',
headers: {
Authorization: 'Bearer mad_live_***',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"jsonrpc": "2.0",
"id": "discord-search-messages-example",
"method": "tools/call",
"params": {
"name": "discord.search_messages",
"arguments": {
"channel_id": "123456789",
"query": "billing",
"date_from": "2026-03-01",
"date_to": "2026-03-29"
}
}
}),
});
const data = await response.json();
console.log(data);
import requests
url = 'https://portal.madpanda3d.com/api/mcp'
headers = {
'Authorization': 'Bearer mad_live_***',
'Content-Type': 'application/json',
}
payload = {
"jsonrpc": "2.0",
"id": "discord-search-messages-example",
"method": "tools/call",
"params": {
"name": "discord.search_messages",
"arguments": {
"channel_id": "123456789",
"query": "billing",
"date_from": "2026-03-01",
"date_to": "2026-03-29"
}
}
}
response = requests.post(url, headers=headers, json=payload, timeout=60)
print(response.json())
Example Responses
- 200 Success
- 400 Invalid Date Range
{
"ok": true,
"results": [
{
"message_id": "ms_91",
"content": "Need billing help",
"author": "user_17"
}
]
}
{
"ok": false,
"error": "validation_error",
"message": "date_from must be before date_to"
}