Skip to main content
Glama

closeContainer

Closes the currently open container in Minecraft to manage inventory and continue gameplay.

Instructions

Close the currently open container

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that closes the currently open container window and clears the currentContainer state.
    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 using server.tool, with empty input schema and the 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