Skip to main content
Glama
Mming-Lab
by Mming-Lab

send_message

Send chat messages to Minecraft Bedrock players via the MCP server. Enables clear communication for build progress, instructions, or updates during gameplay.

Instructions

Send a chat message to the connected Minecraft player. ALWAYS provide a message parameter. Use this to communicate with the player about build progress or instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesThe text message to send to the player (REQUIRED - never call this without a message)

Implementation Reference

  • src/server.ts:404-439 (registration)
    Registration of the 'send_message' MCP tool, including Zod input schema and async handler that delegates to server.sendMessage and returns formatted response.
    this.mcpServer.registerTool(
      "send_message",
      {
        title: "Send Message",
        description:
          "Send a chat message to the connected Minecraft player. ALWAYS provide a message parameter. Use this to communicate with the player about build progress or instructions.",
        inputSchema: {
          message: z
            .string()
            .describe(
              "The text message to send to the player (REQUIRED - never call this without a message)"
            ),
        },
      },
      async ({ message }: { message: string }) => {
        const result = await this.sendMessage(message || "Hello from MCP server!");
    
        let responseText: string;
        if (result.success) {
          responseText = result.message || "Message sent successfully";
        } else {
          // エラーメッセージにヒントを追加
          const errorMsg = result.message || "Failed to send message";
          responseText = `❌ ${enrichErrorWithHints(errorMsg)}`;
        }
    
        return {
          content: [
            {
              type: "text",
              text: responseText,
            },
          ],
        };
      }
    );
  • Core handler method that sends the message to the current Minecraft world/player, with connection checks, logging, and error handling.
    public async sendMessage(text: string): Promise<ToolCallResult> {
      if (!this.currentWorld) {
        if (process.stdin.isTTY !== false) {
          console.error("エラー: プレイヤーが接続されていません");
        }
        return { success: false, message: "No player connected" };
      }
    
      try {
        if (process.stdin.isTTY !== false) {
          console.error(`メッセージ送信: ${text}`);
        }
    
        await this.currentWorld.sendMessage(text);
        return { success: true, message: "Message sent successfully" };
      } catch (error) {
        if (process.stdin.isTTY !== false) {
          console.error("メッセージ送信エラー:", error);
        }
        return { success: false, message: `Failed to send message: ${error}` };
      }
    }
  • Input schema for the 'send_message' tool: requires a string 'message' validated with Zod.
    {
      title: "Send Message",
      description:
        "Send a chat message to the connected Minecraft player. ALWAYS provide a message parameter. Use this to communicate with the player about build progress or instructions.",
      inputSchema: {
        message: z
          .string()
          .describe(
            "The text message to send to the player (REQUIRED - never call this without a message)"
          ),
      },
Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mming-Lab/minecraft-bedrock-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server