Skip to content

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

@aidandaly24

Description

@aidandaly24

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.

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-cdksrc/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 <path> 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions