Rename tool from discord_list_guilds to discord_list_servers for consistency
Co-authored-by: SootyOwl <7614538+SootyOwl@users.noreply.github.com>
This commit is contained in:
parent
e813f60835
commit
730d79d9b9
|
|
@ -12,7 +12,7 @@ A Discord MCP (Model Context Protocol) server that enables AI assistants to inte
|
||||||
MCP-Discord provides the following Discord-related functionalities:
|
MCP-Discord provides the following Discord-related functionalities:
|
||||||
|
|
||||||
- Login to Discord bot
|
- Login to Discord bot
|
||||||
- List guilds (servers) the bot is a member of
|
- List servers the bot is a member of
|
||||||
- Get server information
|
- Get server information
|
||||||
- Read/delete channel messages
|
- Read/delete channel messages
|
||||||
- Send messages to specified channels (using either channel IDs or channel names)
|
- Send messages to specified channels (using either channel IDs or channel names)
|
||||||
|
|
@ -269,7 +269,7 @@ You can use Docker containers with both Claude and Cursor:
|
||||||
### Basic Functions
|
### Basic Functions
|
||||||
|
|
||||||
- `discord_login`: Login to Discord using the configured token
|
- `discord_login`: Login to Discord using the configured token
|
||||||
- `discord_list_guilds`: List all Discord servers (guilds) the bot is a member of
|
- `discord_list_servers`: List all Discord servers the bot is a member of
|
||||||
- `discord_send`: Send a message to a specified channel (supports both channel ID and channel name)
|
- `discord_send`: Send a message to a specified channel (supports both channel ID and channel name)
|
||||||
- `discord_get_server_info`: Get Discord server information
|
- `discord_get_server_info`: Get Discord server information
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,4 +131,4 @@ export const DeleteWebhookSchema = z.object({
|
||||||
reason: z.string().optional()
|
reason: z.string().optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ListGuildsSchema = z.object({});
|
export const ListServersSchema = z.object({});
|
||||||
|
|
@ -30,7 +30,7 @@ import {
|
||||||
createCategoryHandler,
|
createCategoryHandler,
|
||||||
editCategoryHandler,
|
editCategoryHandler,
|
||||||
deleteCategoryHandler,
|
deleteCategoryHandler,
|
||||||
listGuildsHandler
|
listServersHandler
|
||||||
} from './tools/tools.js';
|
} from './tools/tools.js';
|
||||||
import { MCPTransport } from './transport.js';
|
import { MCPTransport } from './transport.js';
|
||||||
import { info, error } from './logger.js';
|
import { info, error } from './logger.js';
|
||||||
|
|
@ -179,9 +179,9 @@ export class DiscordMCPServer {
|
||||||
toolResponse = await deleteWebhookHandler(args, this.toolContext);
|
toolResponse = await deleteWebhookHandler(args, this.toolContext);
|
||||||
return toolResponse;
|
return toolResponse;
|
||||||
|
|
||||||
case "discord_list_guilds":
|
case "discord_list_servers":
|
||||||
this.logClientState("before discord_list_guilds handler");
|
this.logClientState("before discord_list_servers handler");
|
||||||
toolResponse = await listGuildsHandler(args, this.toolContext);
|
toolResponse = await listServersHandler(args, this.toolContext);
|
||||||
return toolResponse;
|
return toolResponse;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -294,8 +294,8 @@ export const toolList = [
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "discord_list_guilds",
|
name: "discord_list_servers",
|
||||||
description: "Lists all Discord servers (guilds) the bot is a member of",
|
description: "Lists all Discord servers the bot is a member of",
|
||||||
inputSchema: {
|
inputSchema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {},
|
properties: {},
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import {
|
||||||
CreateCategorySchema,
|
CreateCategorySchema,
|
||||||
EditCategorySchema,
|
EditCategorySchema,
|
||||||
DeleteCategorySchema,
|
DeleteCategorySchema,
|
||||||
ListGuildsSchema
|
ListServersSchema
|
||||||
} from "../schemas.js";
|
} from "../schemas.js";
|
||||||
import { handleDiscordError } from "../errorHandler.js";
|
import { handleDiscordError } from "../errorHandler.js";
|
||||||
|
|
||||||
|
|
@ -358,12 +358,12 @@ export async function getServerInfoHandler(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// List guilds handler
|
// List servers handler
|
||||||
export async function listGuildsHandler(
|
export async function listServersHandler(
|
||||||
args: unknown,
|
args: unknown,
|
||||||
context: ToolContext
|
context: ToolContext
|
||||||
): Promise<ToolResponse> {
|
): Promise<ToolResponse> {
|
||||||
ListGuildsSchema.parse(args);
|
ListServersSchema.parse(args);
|
||||||
try {
|
try {
|
||||||
if (!context.client.isReady()) {
|
if (!context.client.isReady()) {
|
||||||
return {
|
return {
|
||||||
|
|
@ -376,7 +376,7 @@ export async function listGuildsHandler(
|
||||||
|
|
||||||
if (guilds.size === 0) {
|
if (guilds.size === 0) {
|
||||||
return {
|
return {
|
||||||
content: [{ type: "text", text: "No guilds found. The bot is not a member of any servers." }]
|
content: [{ type: "text", text: "No servers found. The bot is not a member of any servers." }]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import {
|
||||||
createCategoryHandler,
|
createCategoryHandler,
|
||||||
editCategoryHandler,
|
editCategoryHandler,
|
||||||
deleteCategoryHandler,
|
deleteCategoryHandler,
|
||||||
listGuildsHandler
|
listServersHandler
|
||||||
} from './channel.js';
|
} from './channel.js';
|
||||||
import {
|
import {
|
||||||
addReactionHandler,
|
addReactionHandler,
|
||||||
|
|
@ -57,7 +57,7 @@ export {
|
||||||
createCategoryHandler,
|
createCategoryHandler,
|
||||||
editCategoryHandler,
|
editCategoryHandler,
|
||||||
deleteCategoryHandler,
|
deleteCategoryHandler,
|
||||||
listGuildsHandler
|
listServersHandler
|
||||||
};
|
};
|
||||||
|
|
||||||
// Export common types
|
// Export common types
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import {
|
||||||
editCategoryHandler,
|
editCategoryHandler,
|
||||||
createCategoryHandler,
|
createCategoryHandler,
|
||||||
deleteCategoryHandler,
|
deleteCategoryHandler,
|
||||||
listGuildsHandler
|
listServersHandler
|
||||||
} from './tools/tools.js';
|
} from './tools/tools.js';
|
||||||
import { Client, GatewayIntentBits } from "discord.js";
|
import { Client, GatewayIntentBits } from "discord.js";
|
||||||
import { info, error } from './logger.js';
|
import { info, error } from './logger.js';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue