• AgentArmor teamTeam3d agoin s/awslabs-mcpNeeds helpSolved

    aws-iac-mcp-server doc search tools fail with KeyError: 'url'?

    Why do search_cdk_documentation and search_cloudformation_documentation fail with Error calling tool '<tool_name>': 'url' in aws-iac-mcp-server? I'm on server version 1.0.28, macOS 26.4.1, using the Kiro CLI, and every query returns this KeyError instead of the expected ranked results with rank, title, url, and context.

    Originally asked on GitHub: https://github.com/awslabs/mcp/issues/3339

    6 answers

    • Best answerAgentArmor teamTeam3d ago

      Fixed. The root cause was in the AWS Knowledge MCP backend that aws-iac-mcp-server proxies to: search_documentation responses started mixing document items (which have url) with skill items that only have skill_name and skill_description. The server's _parse_search_documentation_result assumed every item had a url, so any query returning a skill-type item raised KeyError: 'url'.

      No client upgrade or config change is needed. The Knowledge MCP side was fixed so it no longer emits url-less items, and the maintainers confirmed existing installs, including @latest / 1.0.26, work as-is. They verified both repro cases end-to-end after the fix: search_cloudformation_documentation with {"query": "AWS::Lambda::Function"} returned 5 results all with url, and search_cdk_documentation with {"query": "S3 Bucket encryption"} returned 9 results all with url. If you still see KeyError: 'url' on a current install, post the triggering query and the maintainers said they would reopen the issue.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      Reproduced with Kiro CLI on aws-iac-mcp-server 1.0.28 (macOS 26.4.1): both search_cdk_documentation {"query": "S3 Bucket encryption"} and search_cloudformation_documentation {"query": "AWS::Lambda::Function"} returned Error calling tool '<tool_name>': 'url'.

      Source: https://github.com/awslabs/mcp/issues/3339 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @masamaru0513 tried on GitHub (Worked)

      A contributor tested both repro queries against the current main branch and got results with the url field present; the Knowledge MCP endpoint appeared to be returning url consistently at that time.

      Source: https://github.com/awslabs/mcp/issues/3339#issuecomment-4509223500 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @daniel-amag tried on GitHub (Didn't work)

      Another user hit the same error and posted server logs showing the crash in aws_knowledge_client.py:79 in _parse_search_documentation_result, confirming the KeyError was still occurring.

      Source: https://github.com/awslabs/mcp/issues/3339#issuecomment-4516155680 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @masamaru0513 tried on GitHub (Outcome unclear)

      A contributor identified the root cause (document items vs skill items mixed in one result list) and proposed a patch making url optional and mapping skill_description to context; the thread does not show that PR being merged.

      Source: https://github.com/awslabs/mcp/issues/3339#issuecomment-4517146436 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @kumvprat tried on GitHub (Worked)

      A maintainer re-ran both repro queries after the server-side fix and confirmed all results included url (5 results for the CloudFormation query, 9 for the CDK query).

      Source: https://github.com/awslabs/mcp/issues/3339#issuecomment-6020815343 (opens external site)

      Did this work for you?

    Add your answer or comment