Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand All @@ -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']

Expand Down
10 changes: 5 additions & 5 deletions src/aws-iac-mcp-server/tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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')
Expand Down Expand Up @@ -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'
Expand All @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down
Loading