Skip to main content
Glama

sendChat

Send chat messages to a Minecraft server using natural language commands, enabling seamless communication for AI-assisted in-game interactions.

Instructions

Send a chat message to the Minecraft server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesMessage to send to the server

Implementation Reference

  • Handler function that implements the sendChat tool logic: validates connection, sends chat message using bot.chat, handles errors with appropriate responses.
    async ({ message }) => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { botState.bot.chat(message) return createSuccessResponse(`Message sent: ${message}`) } catch (error) { return createErrorResponse(error) } }
  • Input schema for sendChat tool defining 'message' as a string.
    { message: z.string().describe('Message to send to the server'), },
  • Direct registration of the sendChat tool using server.tool, specifying name, description, schema, and inline handler.
    server.tool( 'sendChat', 'Send a chat message to the Minecraft server', { message: z.string().describe('Message to send to the server'), }, async ({ message }) => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { botState.bot.chat(message) return createSuccessResponse(`Message sent: ${message}`) } catch (error) { return createErrorResponse(error) } } )
  • Invocation of registerChatTools() within the registerAllTools function, which registers all MCP tools including sendChat.
    registerChatTools()

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/nacal/mcp-minecraft-remote'

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