get_services
Lists all smart services in the CloudNet cluster for monitoring and management purposes.
Instructions
List all smart services
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/cloudnet_mcp/server.py:82-89 (registration)Tool registration: defines the 'get_services' tool with name, description, and empty input schema in the list_tools() function.
types.Tool( name="get_services", description="List all smart services", inputSchema={ "type": "object", "properties": {}, }, ), - src/cloudnet_mcp/server.py:164-182 (handler)Tool handler: in the call_tool() function, handles 'get_services' by making a GET request to the 'service' API endpoint and returning the result 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))] elif name == "get_services": data = await client.request("GET", "service") return [types.TextContent(type="text", text=str(data))]