Skip to content

feat(gateway-target): explicit --listing-mode flag for dynamic tool listing #1363

@aidandaly24

Description

@aidandaly24

Description

Dynamic tool listing on a Gateway Target is partially exposed in CFN today via AWS::BedrockAgentCore::GatewayTarget.TargetConfiguration.Mcp.McpServer.ListingMode — allowed values DEFAULT | DYNAMIC. With DYNAMIC, the gateway calls tools/list on the upstream MCP server at request time instead of caching a static list. Source: McpServerTargetConfiguration CFN docs.

The CLI's schema marks toolDefinitions as optional for mcpServer targets (src/schema/schemas/mcp.ts:346–347) — this implicitly maps to DYNAMIC listing, but:

  1. There is no explicit --listing-mode flag and no schema field in AgentCoreGatewayTargetSchema that maps to ListingMode.
  2. The L3 construct does not pass ListingMode to CfnGatewayTarget; it relies entirely on the presence/absence of toolDefinitions.
  3. There is no CFN support for Lambda-backed dynamic listing today — McpLambdaTargetConfiguration only takes LambdaArn + ToolSchema (InlinePayload or S3 — both static). This is a service-side gap.

Acceptance Criteria

  • Add listingMode?: 'DEFAULT' | 'DYNAMIC' to the mcpServer discriminator in AgentCoreGatewayTargetSchema.
  • Add --listing-mode flag to agentcore add gateway-target --type mcpServer.
  • Surface listing-mode toggle in the TUI for MCP server targets.
  • L3 construct passes the field through to CfnGatewayTarget.TargetConfiguration.Mcp.McpServer.ListingMode.
  • Document that Lambda dynamic listing is NOT supported in CFN (and therefore the CLI) today; track service-team request for that capability.
  • Snapshot tests updated.

Additional Context

  • CFN support: PARTIALMcpServer.ListingMode only; Lambda dynamic listing is not modeled.
  • L3 gap: yes — @aws/agentcore-cdk Gateway target construct needs to pass ListingMode explicitly.
  • Lambda dynamic listing requires a service-side change (no ListingMode on McpLambdaTargetConfiguration); track separately with the service team.
  • Reference: McpServerTargetConfiguration says "MCP resources for dynamic targets will be dynamically retrieved when listing tools".

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