Skip to content

aws-iac-mcp-server: search_cdk_documentation and search_cloudformation_documentation tools fail with KeyError: 'url' #3339

Description

@ggallo

Describe the bug

The search_cdk_documentation and search_cloudformation_documentation tools both fail with the error

Error calling tool '<tool_name>': 'url'.

This appears to be a Python KeyError where the code expects a 'url' key in a dictionary but the key is missing. The error is consistent across different queries.

Expected Behavior

Both tools should return a JSON response with knowledge_response containing ranked search results, each with rank, title, url, and context fields, the same structure that search_cdk_samples_and_constructs and cdk_best_practices successfully return.

Current Behavior

Every call to either tool returns:

  {"content": [{"text": "Error calling tool 'search_cdk_documentation': 'url'", "type": "text"}], "isError": true}

  {"content": [{"text": "Error calling tool 'search_cloudformation_documentation': 'url'", "type": "text"}], "isError": true}

The code is accessing result['url'] (or similar) on a dict that doesn't contain that key.

Reproduction Steps

  1. Connect to the aws-iac-mcp-server via any MCP client (tested with Kiro CLI).

  2. Call search_cdk_documentation with any query, e.g.:

    {"query": "S3 Bucket encryption"}

  3. Observe the error: Error calling tool 'search_cdk_documentation': 'url'

  4. Call search_cloudformation_documentation with any query, e.g.:

    {"query": "AWS::Lambda::Function"}

  5. Observe the same error: Error calling tool 'search_cloudformation_documentation': 'url'

Possible Solution

No response

Additional Information/Context

No response

OS

macOS 26.4.1

Server

aws-iac-mcp-server

Server Version

1.0.28

Region experiencing the issue

us-east-1

Other information

Issue created with AI assistance

Service quota

  • I have reviewed the service quotas for this construct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageThis needs to be handled, it is the first automatically assigned label to issues.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions