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)
        }
      }
    )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the action without behavioral details. It doesn't disclose effects (e.g., whether closing is reversible, if items are saved), permissions needed, or error conditions, which are critical for a mutation tool in a game context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words. It's front-loaded with the core action and target, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is insufficient. It lacks details on what 'close' entails behaviorally, potential side effects, or return values, leaving significant gaps in understanding how the tool operates.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a high baseline score for not adding unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('close') and target ('the currently open container'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'openContainer' beyond the opposite action, missing explicit comparison that would earn a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context ('currently open container') but doesn't specify when to use this tool versus alternatives or prerequisites. It suggests a container must be open first, but lacks explicit guidance on timing or exclusions, leaving usage somewhat ambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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