Skip to main content
Glama

getNearbyPlayers

Retrieve a list of players currently in proximity to your Minecraft character for coordination, interaction, or safety monitoring.

Instructions

Get a list of players nearby

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'getNearbyPlayers' tool using server.tool, including description, empty schema, and inline handler function.
      'getNearbyPlayers',
      'Get a list of players nearby',
      {},
      async () => {
        if (!botState.isConnected || !botState.bot) {
          return createNotConnectedResponse()
        }
    
        try {
          const players = Object.values(botState.bot.players)
            .filter(
              (player) =>
                player.entity && player.username !== botState.bot?.username
            )
            .map((player) => {
              if (!botState.bot) return ''
              const pos = player.entity!.position
              const distance = pos.distanceTo(botState.bot.entity.position)
              return `${player.username} (${distance.toFixed(2)} blocks away)`
            })
    
          if (players.length === 0) {
            return createSuccessResponse('No other players nearby.')
          }
    
          return createSuccessResponse(`Nearby players: ${players.join(', ')}`)
        } catch (error) {
          return createErrorResponse(error)
        }
      }
    )
  • The handler function that executes the getNearbyPlayers tool logic: checks connection, retrieves nearby players from botState.bot.players, filters out self, calculates distances, and returns formatted success response or error.
      if (!botState.isConnected || !botState.bot) {
        return createNotConnectedResponse()
      }
    
      try {
        const players = Object.values(botState.bot.players)
          .filter(
            (player) =>
              player.entity && player.username !== botState.bot?.username
          )
          .map((player) => {
            if (!botState.bot) return ''
            const pos = player.entity!.position
            const distance = pos.distanceTo(botState.bot.entity.position)
            return `${player.username} (${distance.toFixed(2)} blocks away)`
          })
    
        if (players.length === 0) {
          return createSuccessResponse('No other players nearby.')
        }
    
        return createSuccessResponse(`Nearby players: ${players.join(', ')}`)
      } catch (error) {
        return createErrorResponse(error)
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states what the tool does but lacks behavioral details such as range limits, update frequency, or response format. This leaves gaps in understanding how the tool behaves operationally.

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 no wasted words. It's front-loaded and efficiently conveys the core action, making it easy to parse quickly.

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?

Given no annotations, no output schema, and a simple tool, the description is minimal. It states the purpose but lacks context on behavior, output format, or differentiation from siblings, making it incomplete for effective agent use.

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 doesn't add param info, but that's acceptable here, as the baseline is high due to the lack of parameters.

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 verb ('Get') and resource ('list of players nearby'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'getNearbyEntities' or 'getPosition', which limits its specificity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'getNearbyEntities' and 'getPosition', there's no indication of how this tool differs in context or application.

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