diff --git a/src/aws-iac-mcp-server/awslabs/aws_iac_mcp_server/server.py b/src/aws-iac-mcp-server/awslabs/aws_iac_mcp_server/server.py index e94cdb2fad..f72355fd48 100644 --- a/src/aws-iac-mcp-server/awslabs/aws_iac_mcp_server/server.py +++ b/src/aws-iac-mcp-server/awslabs/aws_iac_mcp_server/server.py @@ -317,7 +317,7 @@ async def search_cdk_documentation(query: str) -> str: Use rank to prioritize results. Check error field first - if not null, the search failed. - If a content snippet is relevant to your query but doesn't show all necessary information, use `read_cdk_documentation_page` with the URL to get the complete content. + If a content snippet is relevant to your query but doesn't show all necessary information, use `read_iac_documentation_page` with the URL to get the complete content. Args: query: Search query for CDK documentation (required) diff --git a/src/aws-iac-mcp-server/awslabs/aws_iac_mcp_server/tools/iac_tools.py b/src/aws-iac-mcp-server/awslabs/aws_iac_mcp_server/tools/iac_tools.py index 74ae7c90c1..9614055042 100644 --- a/src/aws-iac-mcp-server/awslabs/aws_iac_mcp_server/tools/iac_tools.py +++ b/src/aws-iac-mcp-server/awslabs/aws_iac_mcp_server/tools/iac_tools.py @@ -18,7 +18,7 @@ from typing import Literal -SEARCH_TOOL_NEXT_STEPS_GUIDANCE = 'To read the full documentation pages for these search results, use the `read_cdk_documentation_page` tool. If you need to find real code examples for constructs referenced in the search results, use the `search_cdk_samples_and_constructs` tool.' +SEARCH_TOOL_NEXT_STEPS_GUIDANCE = 'To read the full documentation pages for these search results, use the `read_iac_documentation_page` tool. If you need to find real code examples for constructs referenced in the search results, use the `search_cdk_samples_and_constructs` tool.' READ_TOOL_NEXT_STEPS_GUIDANCE = ( 'If you need code examples, use `search_cdk_samples_and_constructs` tool.' @@ -27,7 +27,7 @@ SEARCH_CDK_DOCUMENTATION_TOPIC = 'cdk_docs' SEARCH_CLOUDFORMATION_DOCUMENTATION_TOPIC = 'cloudformation' SEARCH_CDK_CONSTRUCTS_TOPIC = 'cdk_constructs' -SAMPLE_CONSTRUCT_SEARCH_TOOL_NEXT_STEPS_GUIDANCE = 'To read the full documentation pages for these search results, use the `read_cdk_documentation_page` tool.' +SAMPLE_CONSTRUCT_SEARCH_TOOL_NEXT_STEPS_GUIDANCE = 'To read the full documentation pages for these search results, use the `read_iac_documentation_page` tool.' SupportedLanguages = Literal['typescript', 'python', 'java', 'csharp', 'go'] diff --git a/src/aws-iac-mcp-server/tests/test_server.py b/src/aws-iac-mcp-server/tests/test_server.py index 874ecd374a..4ac69f0572 100644 --- a/src/aws-iac-mcp-server/tests/test_server.py +++ b/src/aws-iac-mcp-server/tests/test_server.py @@ -201,7 +201,7 @@ async def test_search_cdk_documentation_success(self, mock_sanitize, mock_search """Test successful CDK documentation search.""" mock_response = CDKToolResponse( knowledge_response=[], - next_step_guidance='To read the full documentation pages for these search results, use the `read_cdk_documentation_page` tool. If you need to find real code examples for constructs referenced in the search results, use the `search_cdk_samples_and_constructs` tool.', + next_step_guidance='To read the full documentation pages for these search results, use the `read_iac_documentation_page` tool. If you need to find real code examples for constructs referenced in the search results, use the `search_cdk_samples_and_constructs` tool.', ) mock_search.return_value = mock_response mock_sanitize.return_value = 'sanitized response' @@ -213,8 +213,8 @@ async def test_search_cdk_documentation_success(self, mock_sanitize, mock_search mock_sanitize.assert_called_once() -class TestReadCdkDocumentationPage: - """Test read_cdk_documentation_page tool.""" +class TestReadIaCDocumentationPage: + """Test read_iac_documentation_page tool.""" @patch('awslabs.aws_iac_mcp_server.server.read_iac_documentation_page_tool') @patch('awslabs.aws_iac_mcp_server.server.sanitize_tool_response') @@ -280,7 +280,7 @@ async def test_search_cdk_samples_and_constructs_success(self, mock_sanitize, mo """Test successful CDK samples and constructs search.""" mock_response = CDKToolResponse( knowledge_response=[], - next_step_guidance='To read the full documentation pages for these search results, use the `read_cdk_documentation_page` tool.', + next_step_guidance='To read the full documentation pages for these search results, use the `read_iac_documentation_page` tool.', ) mock_search.return_value = mock_response mock_sanitize.return_value = 'sanitized response' @@ -300,7 +300,7 @@ async def test_search_cdk_samples_and_constructs_with_language( """Test CDK samples search with specific language.""" mock_response = CDKToolResponse( knowledge_response=[], - next_step_guidance='To read the full documentation pages for these search results, use the `read_cdk_documentation_page` tool.', + next_step_guidance='To read the full documentation pages for these search results, use the `read_iac_documentation_page` tool.', ) mock_search.return_value = mock_response mock_sanitize.return_value = 'sanitized response' diff --git a/src/aws-iac-mcp-server/tests/tools/test_read_cdk_documentation_page_tool.py b/src/aws-iac-mcp-server/tests/tools/test_read_cdk_documentation_page_tool.py index d31fa25980..75fdd35c98 100644 --- a/src/aws-iac-mcp-server/tests/tools/test_read_cdk_documentation_page_tool.py +++ b/src/aws-iac-mcp-server/tests/tools/test_read_cdk_documentation_page_tool.py @@ -20,11 +20,11 @@ from unittest.mock import AsyncMock, patch -class TestReadCDKDocumentationPage: - """Test read_cdk_documentation_page_tool function.""" +class TestReadIaCDocumentationPage: + """Test read_iac_documentation_page_tool function.""" @pytest.mark.asyncio - async def test_read_cdk_documentation_page_success(self): + async def test_read_iac_documentation_page_success(self): """Test successful CDK documentation page read.""" mock_response = [ KnowledgeResult( @@ -52,7 +52,7 @@ async def test_read_cdk_documentation_page_success(self): ) @pytest.mark.asyncio - async def test_read_cdk_documentation_page_with_start_index(self): + async def test_read_iac_documentation_page_with_start_index(self): """Test CDK documentation page read with start index.""" with patch( 'awslabs.aws_iac_mcp_server.tools.iac_tools.read_documentation', @@ -69,7 +69,7 @@ async def test_read_cdk_documentation_page_with_start_index(self): ) @pytest.mark.asyncio - async def test_read_cdk_documentation_page_error(self): + async def test_read_iac_documentation_page_error(self): """Test CDK documentation page read with error handling.""" with patch( 'awslabs.aws_iac_mcp_server.tools.iac_tools.read_documentation',