Skip to main content
Glama

execute_service_command

Execute a command on any CloudNet service console by providing the service identifier and command string. Automate service management tasks.

Instructions

Executes the specified command on a service console

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesThe name or unique id of the service
commandYesThe command to execute on the service

Implementation Reference

  • Tool schema/registration for execute_service_command — defines name, description, and inputSchema with identifier and command parameters.
    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"],
        },
    ),
  • Handler implementation for execute_service_command — extracts identifier and command from arguments, sends a POST request to the CloudNet API at service/{identifier}/command.
    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))]
  • Tool listing/registration via @app.list_tools() — all tools including execute_service_command are declared here.
    @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"],
                },
            ),
        ]
  • CloudNetClient helper class — handles authentication, token refresh, and HTTP requests used by the handler.
    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()
Behavior2/5

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

No annotations provided; the description only says 'executes the specified command', implying a write operation but no details on destructive potential, authorization needs, or side effects.

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

Conciseness4/5

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

The description is a single sentence of 8 words, very concise. It could be slightly improved with additional context while remaining brief.

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 the simplicity (2 params, no output schema, no annotations), the description is minimal and does not explain return values or behavior. Incomplete for safe invocation.

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% (both parameters have descriptions). The description adds no extra meaning beyond the schema, so baseline of 3 is appropriate.

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 ('executes the specified command') and the target ('service console'). It distinguishes from sibling 'execute_player_command' by specifying 'service console', but does not explicitly differentiate.

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 or not use this tool, nor any mention of prerequisites or alternatives. The description lacks context for decision-making.

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