Skip to main content
Glama

get_node_info

Retrieve detailed information about a specific node by providing its ID. Access node status, configuration, and metrics from CloudNet infrastructure.

Instructions

Get detailed information about a specific node

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
node_idYesThe ID of the node

Implementation Reference

  • CloudNetClient class that handles HTTP communication with the CloudNet API, including authentication and request retry logic. Used by all tool handlers including get_node_info.
    import asyncio
    import os
    import httpx
    from pydantic import BaseModel, Field
    from typing import Optional, Dict, Any, List
    import mcp.types as types
    from mcp.server import Server
    from mcp.server.stdio import stdio_server
    
    app = Server("cloudnet-mcp")
    
    CLOUDNET_URL = os.environ.get("CLOUDNET_URL", "http://127.0.0.1:2812/api/v3")
    CLOUDNET_USER = os.environ.get("CLOUDNET_USER", "admin")
    CLOUDNET_PASSWORD = os.environ.get("CLOUDNET_PASSWORD", "admin")
    
    class CloudNetClient:
        def __init__(self, base_url: str, user: str, password: str):
            self.base_url = base_url.rstrip("/")
            self.user = user
            self.password = password
            self.token = None
            self.client = httpx.AsyncClient()
    
        async def _authenticate(self):
            resp = await self.client.post(
                f"{self.base_url}/auth",
                auth=(self.user, self.password)
            )
            resp.raise_for_status()
            data = resp.json()
            self.token = data.get("token")
            self.client.headers.update({"Authorization": f"Bearer {self.token}"})
    
        async def request(self, method: str, endpoint: str, **kwargs):
            if not self.token:
                await self._authenticate()
            
            path = endpoint.lstrip("/")
            url = f"{self.base_url}/{path}"
            
            try:
                resp = await self.client.request(method, url, **kwargs)
                if resp.status_code == 401:
                    # Token might be expired, re-authenticate and retry
                    await self._authenticate()
                    resp = await self.client.request(method, url, **kwargs)
                resp.raise_for_status()
                if resp.status_code == 204:
                    return {"status": "success"}
                return resp.json()
            except httpx.HTTPError as e:
                return {"error": str(e)}
    
        async def close(self):
            await self.client.aclose()
  • Registration of the get_node_info tool through the @app.list_tools() decorator. Defines the tool's name, description, and inputSchema requiring a 'node_id' string 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"],
                },
            ),
  • Handler for get_node_info tool in the @app.call_tool() decorated function. Extracts 'node_id' from arguments, validates it, and makes a GET request to 'node/{node_id}' via CloudNetClient, returning the response as text.
    @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))]
Behavior2/5

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

With no annotations, the description should disclose behavioral traits. It merely states the function without mentioning read-only nature, permissions, or any side effects, leaving the agent to infer from the verb 'get'.

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?

One sentence with no extraneous words. Highly efficient and front-loaded.

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?

Despite simplicity, the lack of output schema and any hint of what 'detailed information' includes makes the description incomplete. An agent cannot anticipate the return structure.

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 coverage is 100% with parameter description 'The ID of the node'. The tool description adds no additional context beyond the schema, baseline of 3 applies.

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?

The description 'Get detailed information about a specific node' clearly states the verb (Get) and resource (node), effectively distinguishing it from sibling 'get_nodes' which lists multiple nodes.

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 is provided on when to use this tool versus alternatives like 'get_nodes' or 'get_player_info'. The description lacks context for tool selection.

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