Skip to main content
Glama

get_player_info

Get a player's information by providing their name or unique ID to enable efficient player management and monitoring within a cloud network.

Instructions

Get a player by their unique id or name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesThe name or unique id of the player

Implementation Reference

  • The list_tools() function registers all available MCP tools including get_player_info (lines 102-112) with its input schema defining a required 'identifier' parameter.
    @app.list_tools()
    async def list_tools() -> list[types.Tool]:
        return [
            types.Tool(
                name="get_nodes",
                description="List all nodes in the CloudNet cluster",
                inputSchema={
                    "type": "object",
                    "properties": {},
                },
            ),
            types.Tool(
                name="get_node_info",
                description="Get detailed information about a specific node",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "node_id": {"type": "string", "description": "The ID of the node"}
                    },
                    "required": ["node_id"],
                },
            ),
            types.Tool(
                name="get_services",
                description="List all smart services",
                inputSchema={
                    "type": "object",
                    "properties": {},
                },
            ),
            types.Tool(
                name="get_online_players",
                description="Get a list of online players based on the query parameters",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "limit": {"type": "integer", "description": "The maximum amount of players to respond with"},
                        "skip": {"type": "integer", "description": "The amount of players to skip"},
                        "sort": {"type": "string", "enum": ["asc", "desc"], "description": "Sort players by name"},
                    },
                },
            ),
            types.Tool(
                name="get_player_info",
                description="Get a player by their unique id or name",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "identifier": {"type": "string", "description": "The name or unique id of the player"}
                    },
                    "required": ["identifier"],
                },
            ),
            types.Tool(
                name="kick_player",
                description="Kicks a given player from the entire network",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "identifier": {"type": "string", "description": "The name or unique id of the player"},
                        "message": {"type": "string", "description": "The kick message/reason"}
                    },
                    "required": ["identifier", "message"],
                },
            ),
            types.Tool(
                name="send_player_message",
                description="Sends a chat message to a given player",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "identifier": {"type": "string", "description": "The name or unique id of the player"},
                        "message": {"type": "string", "description": "The chat message to send"}
                    },
                    "required": ["identifier", "message"],
                },
            ),
            types.Tool(
                name="execute_player_command",
                description="Executes a command for a given player",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "identifier": {"type": "string", "description": "The name or unique id of the player"},
                        "command": {"type": "string", "description": "The command to execute (without prefixing slash)"},
                        "redirectToServer": {"type": "boolean", "description": "Redirect downstream if not found on proxy"}
                    },
                    "required": ["identifier", "command"],
                },
            ),
            types.Tool(
                name="execute_service_command",
                description="Executes the specified command on a service console",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "identifier": {"type": "string", "description": "The name or unique id of the service"},
                        "command": {"type": "string", "description": "The command to execute on the service"}
                    },
                    "required": ["identifier", "command"],
                },
            ),
        ]
  • The Tool definition for 'get_player_info' specifying the input schema: a required string 'identifier' property (name or unique id of the player).
    types.Tool(
        name="get_player_info",
        description="Get a player by their unique id or name",
        inputSchema={
            "type": "object",
            "properties": {
                "identifier": {"type": "string", "description": "The name or unique id of the player"}
            },
            "required": ["identifier"],
        },
    ),
  • The call_tool() function is the handler for all tools. For get_player_info (lines 190-193), it extracts the 'identifier' argument and makes a GET request to 'player/online/{identifier}' via the CloudNet API client.
    @app.call_tool()
    async def call_tool(
        name: str, arguments: dict[str, Any] | None
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        if arguments is None:
            arguments = {}
    
        if name == "get_nodes":
            data = await client.request("GET", "node")
            return [types.TextContent(type="text", text=str(data))]
        elif name == "get_node_info":
            node_id = arguments.get("node_id")
            if not node_id:
                raise ValueError("node_id is required")
            data = await client.request("GET", f"node/{node_id}")
            return [types.TextContent(type="text", text=str(data))]
        elif name == "get_services":
            data = await client.request("GET", "service")
            return [types.TextContent(type="text", text=str(data))]
        elif name == "get_online_players":
            params = {}
            for key in ["limit", "skip", "sort"]:
                if key in arguments:
                    params[key] = arguments[key]
            data = await client.request("GET", "player/online", params=params)
            return [types.TextContent(type="text", text=str(data))]
        elif name == "get_player_info":
            identifier = arguments.get("identifier")
            data = await client.request("GET", f"player/online/{identifier}")
            return [types.TextContent(type="text", text=str(data))]
        elif name == "kick_player":
            identifier = arguments.get("identifier")
            msg = arguments.get("message")
            data = await client.request("POST", f"player/online/{identifier}/kick", json={"kickMessage": msg})
            return [types.TextContent(type="text", text=str(data))]
        elif name == "send_player_message":
            identifier = arguments.get("identifier")
            msg = arguments.get("message")
            data = await client.request("POST", f"player/online/{identifier}/sendChat", json={"chatMessage": msg})
            return [types.TextContent(type="text", text=str(data))]
        elif name == "execute_player_command":
            identifier = arguments.get("identifier")
            cmd = arguments.get("command")
            params = {}
            if "redirectToServer" in arguments:
                params["redirectToServer"] = str(arguments["redirectToServer"]).lower()
            data = await client.request("POST", f"player/online/{identifier}/command", params=params, json={"command": cmd})
            return [types.TextContent(type="text", text=str(data))]
        elif name == "execute_service_command":
            identifier = arguments.get("identifier")
            cmd = arguments.get("command")
            data = await client.request("POST", f"service/{identifier}/command", json={"command": cmd})
            return [types.TextContent(type="text", text=str(data))]
        else:
            raise ValueError(f"Unknown tool: {name}")
Behavior2/5

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

No annotations provided, and description lacks details like read-only nature, permission requirements, or return format. Minimal behavioral disclosure.

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?

Single sentence, 9 words, direct and efficient. No extraneous information.

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

Completeness3/5

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

Adequate for a simple lookup tool, but lacks details about return value or scope. Could be more complete given no output schema and no annotations.

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

Parameters3/5

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

Schema has 100% coverage; description merely restates the schema meaning. No additional semantic value beyond what the schema already provides.

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

Purpose5/5

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

Clearly states it retrieves a player by identifier (name or id). Distinguishes from siblings like get_online_players (multiple players) and get_nodes (different resource).

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?

No guidance on when to use this tool versus alternatives. Does not mention that get_online_players is for listing multiple players or that execute_player_command is for actions.

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/Ergo042/cloudnet-mcp'

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