Skip to content

Commit b5d7f91

Browse files
committed
refactor: rename prompt from get_instances to get_servers
Align naming with compute_tools convention (server over instance) as suggested in code review.
1 parent 6881c0b commit b5d7f91

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/openstack_mcp_server/prompts/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ def register_prompt(mcp: FastMCP):
77
"""
88

99
@mcp.prompt()
10-
def get_instances_by_security_group(security_group_name: str) -> str:
10+
def get_servers_by_security_group(security_group_name: str) -> str:
1111
"""
12-
Get instances associated with a specific security group.
12+
Get servers associated with a specific security group.
1313
14-
:param security_group_name: The name of the security group to filter instances by.
14+
:param security_group_name: The name of the security group to filter servers by.
1515
"""
1616
return (
17-
f"Find all compute instances that have the security group "
17+
f"Find all compute servers that have the security group "
1818
f"'{security_group_name}' attached.\n\n"
1919
f"Steps:\n"
2020
f"1. Call get_servers to list all servers.\n"

tests/prompts/test_prompts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from openstack_mcp_server.prompts import register_prompt
22

33

4-
def test_get_instances_by_security_group_prompt_registered():
4+
def test_get_servers_by_security_group_prompt_registered():
55
"""Test that the prompt is registered with the MCP instance."""
66
from unittest.mock import MagicMock
77

@@ -10,17 +10,17 @@ def test_get_instances_by_security_group_prompt_registered():
1010
mcp.prompt.assert_called()
1111

1212

13-
def test_get_instances_by_security_group_prompt_content():
13+
def test_get_servers_by_security_group_prompt_content():
1414
"""Test that the prompt returns expected content."""
1515
from fastmcp import FastMCP
1616

1717
mcp = FastMCP("test")
1818
register_prompt(mcp)
1919

2020
prompts = mcp._prompt_manager._prompts
21-
assert "get_instances_by_security_group" in prompts
21+
assert "get_servers_by_security_group" in prompts
2222

23-
prompt_obj = prompts["get_instances_by_security_group"]
23+
prompt_obj = prompts["get_servers_by_security_group"]
2424
assert prompt_obj.fn is not None
2525

2626
result = prompt_obj.fn(security_group_name="my-sg")

0 commit comments

Comments
 (0)