Skip to content

fix(tool): resolve HTTP gateways in add tool --gateway (#1658 follow-up)#1693

Merged
tejaskash merged 1 commit into
aws:mainfrom
rostcheck:fix/tool-action-gateway-lookup
Jul 8, 2026
Merged

fix(tool): resolve HTTP gateways in add tool --gateway (#1658 follow-up)#1693
tejaskash merged 1 commit into
aws:mainfrom
rostcheck:fix/tool-action-gateway-lookup

Conversation

@rostcheck

Copy link
Copy Markdown
Contributor

agentcore add tool --gateway <name> only searched resources.mcp.gateways for the named gateway, missing HTTP gateways stored under resources.gateways. This is the same root cause as #1658 (fixed in #1663 for PolicyPrimitive), but the fix was not applied to tool-action.ts.

Replace the manual lookup with the findDeployedGateway() helper introduced in #1663, which correctly merges both gateway storage locations and searches across all deployment targets.

Fixes the scenario where a user deploys an HTTP gateway (e.g. with CUSTOM_JWT auth) and then cannot reference it by name in add tool.

Description

In tool-action.ts imports findDeployedGateway from primitives/deployed-gateways, uses it to resolve the gateway (replacing the code that searched deployedState.targets keys). Also adds a unit test tool-action.test.ts since that was missing

Related Issue

Closes #1692

Documentation PR

No PR (no doc changes)

Type of Change

  • [X ] Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • [X ] I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

…llow-up)

`agentcore add tool --gateway <name>` only searched
`resources.mcp.gateways` for the named gateway, missing HTTP gateways
stored under `resources.gateways`. This is the same root cause as aws#1658
(fixed in aws#1663 for PolicyPrimitive), but the fix was not applied to
`tool-action.ts`.

Replace the manual lookup with the `findDeployedGateway()` helper
introduced in aws#1663, which correctly merges both gateway storage
locations and searches across all deployment targets.

Fixes the scenario where a user deploys an HTTP gateway (e.g. with
CUSTOM_JWT auth) and then cannot reference it by name in `add tool`.
@rostcheck rostcheck requested a review from a team July 7, 2026 00:25
@github-actions github-actions Bot added the size/m PR size: M label Jul 7, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jul 8, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jul 8, 2026

@tejaskash tejaskash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for your contribution.

@tejaskash tejaskash merged commit bb9cf2b into aws:main Jul 8, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(tool): agentcore add tool --gateway <name> fails to find gateway in deployed state

2 participants