aws / aws/agentcore-cli

feat(gateway-target): expose toolOverrides and multiple toolFilters via CLI flags

Open
#1,364 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
283
Forks
95
Avg merge
1d 2h
Merged PRs (30d)
183

Description

### Description

`AWS::BedrockAgentCore::GatewayTarget.TargetConfiguration.Mcp.ApiGateway.ApiGatewayToolConfiguration` exposes two arrays customers use to control which tools are generated from an upstream API Gateway target:

- `ToolFilters` — array of `ApiGatewayToolFilter` (`FilterPath` + `Methods`) — restricts which routes become tools.
- `ToolOverrides` — array of `ApiGatewayToolOverride` — explicit tool definitions with custom names/descriptions/method/path overrides.

Source: [ApiGatewayToolConfiguration CFN docs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-bedrockagentcore-gatewaytarget-apigatewaytoolconfiguration.md).

CLI status today (verified in this codebase):

- The schema in `src/schema/schemas/mcp.ts:72–86` defines both `ApiGatewayToolFilterSchema` and `ApiGatewayToolOverrideSchema`.
- The L3 construct (`@aws/agentcore-cdk` — `src/cdk/constructs/components/mcp/Gateway.ts:324–336`) passes both through to CFN.
- `agentcore add gateway-target` exposes `--tool-filter-path` and `--tool-filter-methods` (single filter only; see `src/cli/commands/add/types.ts:83–84` and `validate.ts:503–506`).
- **There is no CLI flag for `toolOverrides`** — customers can only set them by hand-editing `agentcore.json` or by importing from another project.
- The TUI does not surface either filters or overrides as a first-class step.

### Acceptance Criteria

- [ ] Allow multiple `--tool-filter-path` / `--tool-filter-methods` pairs on a single command (today only one filter is accepted).
- [ ] Add CLI flags for `toolOverrides` — either repeatable `--tool-override` JSON args or a `--tool-overrides-file ` flag pointing to a JSON file.
- [ ] Surface tool filter and tool override entry in the `AddGatewayTargetFlow.tsx` TUI, gated behind an "Advanced API Gateway options" sub-screen.
- [ ] Document the difference (filters = subset, overrides = explicit) in CLI help text.
- [ ] Validate filters/overrides against the upstream API Gateway's known routes during `agentcore deploy --diff` if possible.
- [ ] Snapshot tests covering the new flags.

### Additional Context

- CFN support: **YES** — both `ToolFilters` and `ToolOverrides` are in CFN.
- L3 surface: already complete — this issue is purely CLI/TUI.
- Existing import path covers them (`src/cli/commands/import/import-gateway.ts:76–82`); reuse the mapping helper for the new `add` flow.
- Existing single-filter flag pair: `--tool-filter-path`, `--tool-filter-methods` — needs to become repeatable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.