Skip to main content
Glama

closeContainer

Automates the closing of open containers in Minecraft through remote server commands, streamlining inventory management and interactions.

Instructions

Close the currently open container

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that closes the currently open container by calling bot.closeWindow and clearing botState.currentContainer.
    async () => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { // Check if a container is open if (!botState.currentContainer) { return createSuccessResponse('No container is currently open.') } // Close the container if (botState.bot.currentWindow) { await botState.bot.closeWindow(botState.bot.currentWindow) } botState.currentContainer = null return createSuccessResponse('Container closed successfully.') } catch (error) { return createErrorResponse(error) } }
  • Registration of the 'closeContainer' tool via server.tool(), with no input parameters and the inline handler function.
    server.tool( 'closeContainer', 'Close the currently open container', {}, async () => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { // Check if a container is open if (!botState.currentContainer) { return createSuccessResponse('No container is currently open.') } // Close the container if (botState.bot.currentWindow) { await botState.bot.closeWindow(botState.bot.currentWindow) } botState.currentContainer = null return createSuccessResponse('Container closed successfully.') } catch (error) { return createErrorResponse(error) } } )

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