1- from .base import get_openstack_conn
21from fastmcp import FastMCP
3- from openstack_mcp_server .tools .response .nova import Server
2+
3+ from openstack_mcp_server .tools .response .compute import Server
4+
5+ from .base import get_openstack_conn
46
57
6- class NovaTools :
8+ class ComputeTools :
79 """
8- A class to encapsulate Nova -related tools and utilities.
10+ A class to encapsulate Compute -related tools and utilities.
911 """
1012
1113 def register_tools (self , mcp : FastMCP ):
1214 """
13- Register Nova -related tools with the FastMCP instance.
15+ Register Compute -related tools with the FastMCP instance.
1416 """
1517
16- mcp .tool ()(self .get_nova_servers )
17- mcp .tool ()(self .get_nova_server )
18+ mcp .tool ()(self .get_compute_servers )
19+ mcp .tool ()(self .get_compute_server )
1820
19- def get_nova_servers (self ) -> list [Server ]:
21+ def get_compute_servers (self ) -> list [Server ]:
2022 """
21- Get the list of Nova servers by invoking the registered tool.
23+ Get the list of Compute servers by invoking the registered tool.
2224
23- :return: A list of Server objects representing the Nova servers.
25+ :return: A list of Server objects representing the Compute servers.
2426 """
2527 # Initialize connection
2628 conn = get_openstack_conn ()
@@ -29,17 +31,17 @@ def get_nova_servers(self) -> list[Server]:
2931 server_list = []
3032 for server in conn .compute .servers ():
3133 server_list .append (
32- Server (name = server .name , id = server .id , status = server .status )
34+ Server (name = server .name , id = server .id , status = server .status ),
3335 )
3436
3537 return server_list
3638
37- def get_nova_server (self , id : str ) -> Server :
39+ def get_compute_server (self , id : str ) -> Server :
3840 """
39- Get a specific Nova server by invoking the registered tool.
41+ Get a specific Compute server by invoking the registered tool.
4042
4143 :param id: The ID of the server to retrieve.
42- :return: A Server object representing the Nova server.
44+ :return: A Server object representing the Compute server.
4345 """
4446 # Initialize connection
4547 conn = get_openstack_conn ()
0 commit comments