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:
|
||||
|
||||
- Login to Discord bot
|
||||
- List guilds (servers) the bot is a member of
|
||||
- List servers the bot is a member of
|
||||
- Get server information
|
||||
- Read/delete channel messages
|
||||
- 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
|
||||
|
||||
- `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_get_server_info`: Get Discord server information
|
||||
|
||||
|
|
|
|||
|
|
@ -131,4 +131,4 @@ export const DeleteWebhookSchema = z.object({
|
|||
reason: z.string().optional()
|
||||
});
|
||||
|
||||
export const ListGuildsSchema = z.object({});
|
||||
export const ListServersSchema = z.object({});
|
||||
|
|
@ -30,7 +30,7 @@ import {
|
|||
createCategoryHandler,
|
||||
editCategoryHandler,
|
||||
deleteCategoryHandler,
|
||||
listGuildsHandler
|
||||
listServersHandler
|
||||
} from './tools/tools.js';
|
||||
import { MCPTransport } from './transport.js';
|
||||
import { info, error } from './logger.js';
|
||||
|
|
@ -179,9 +179,9 @@ export class DiscordMCPServer {
|
|||
toolResponse = await deleteWebhookHandler(args, this.toolContext);
|
||||
return toolResponse;
|
||||
|
||||
case "discord_list_guilds":
|
||||
this.logClientState("before discord_list_guilds handler");
|
||||
toolResponse = await listGuildsHandler(args, this.toolContext);
|
||||
case "discord_list_servers":
|
||||
this.logClientState("before discord_list_servers handler");
|
||||
toolResponse = await listServersHandler(args, this.toolContext);
|
||||
return toolResponse;
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -294,8 +294,8 @@ export const toolList = [
|
|||
}
|
||||
},
|
||||
{
|
||||
name: "discord_list_guilds",
|
||||
description: "Lists all Discord servers (guilds) the bot is a member of",
|
||||
name: "discord_list_servers",
|
||||
description: "Lists all Discord servers the bot is a member of",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {},
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
CreateCategorySchema,
|
||||
EditCategorySchema,
|
||||
DeleteCategorySchema,
|
||||
ListGuildsSchema
|
||||
ListServersSchema
|
||||
} from "../schemas.js";
|
||||
import { handleDiscordError } from "../errorHandler.js";
|
||||
|
||||
|
|
@ -358,12 +358,12 @@ export async function getServerInfoHandler(
|
|||
}
|
||||
}
|
||||
|
||||
// List guilds handler
|
||||
export async function listGuildsHandler(
|
||||
// List servers handler
|
||||
export async function listServersHandler(
|
||||
args: unknown,
|
||||
context: ToolContext
|
||||
): Promise<ToolResponse> {
|
||||
ListGuildsSchema.parse(args);
|
||||
ListServersSchema.parse(args);
|
||||
try {
|
||||
if (!context.client.isReady()) {
|
||||
return {
|
||||
|
|
@ -376,7 +376,7 @@ export async function listGuildsHandler(
|
|||
|
||||
if (guilds.size === 0) {
|
||||
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,
|
||||
editCategoryHandler,
|
||||
deleteCategoryHandler,
|
||||
listGuildsHandler
|
||||
listServersHandler
|
||||
} from './channel.js';
|
||||
import {
|
||||
addReactionHandler,
|
||||
|
|
@ -57,7 +57,7 @@ export {
|
|||
createCategoryHandler,
|
||||
editCategoryHandler,
|
||||
deleteCategoryHandler,
|
||||
listGuildsHandler
|
||||
listServersHandler
|
||||
};
|
||||
|
||||
// Export common types
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import {
|
|||
editCategoryHandler,
|
||||
createCategoryHandler,
|
||||
deleteCategoryHandler,
|
||||
listGuildsHandler
|
||||
listServersHandler
|
||||
} from './tools/tools.js';
|
||||
import { Client, GatewayIntentBits } from "discord.js";
|
||||
import { info, error } from './logger.js';
|
||||
|
|
|
|||
Loading…
Reference in New Issue