Skip to content

feat(project): rename mcpRuntimeTools to toolRuntimes in agentcore.json - #2315

Merged
tejaskash merged 4 commits into
refactorfrom
feat/tool-runtimes-key
Sep 16, 2026
Merged

tejaskash merged 4 commits into
refactorfrom
feat/tool-runtimes-key

Conversation

@tejaskash

@tejaskash tejaskash commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Renames the agentcore.json key mcpRuntimeTools to toolRuntimes, matching aws/agentcore-l3-cdk-constructs#376. Schema types follow (ToolRuntimeSchema, ToolRuntimeBindingSchema). The Inspector resources field is renamed too.

Breaking. A project that still says mcpRuntimeTools fails with Unrecognized key: "mcpRuntimeTools". Rename the key by hand.

Also fixes the tool runtime schema, which required artifact where the L3 uses build, so no tool runtime ever validated (since #1992).

Until the next RC bump of @aws/agentcore-cdk and @aws/agent-inspector, tool runtimes do not synthesize and the Inspector panel shows none. Accepted.

Testing

  • typecheck, lint, format, full bun test pass. New schema test covers the new key and the rejected old one.
  • Live deploy in us-west-2 through the CLI, on feat(project): vend a thin CDK app built on transformAgentCoreJson #2249 plus this branch against a tarball of the L3 rename: create, add runtime, gateway, Lambda target, a toolRuntimes entry, build, deploy, status, invoke, negative check of the old key, teardown.

The schema key, ToolRuntimeSchema, ToolRuntimeBindingSchema and their
types follow the L3 rename. The strict project schema rejects the old key
with the Zod unrecognized-key error. There is no loader migration.
Existing projects rename mcpRuntimeTools to toolRuntimes in
agentcore.json.

The Inspector wire field stays mcpRuntimeTools because the SPA comes from
the pinned @aws/agent-inspector npm package.

The vended CDK app passes toolRuntimes to the L3. That path is held until
@aws/agentcore-cdk publishes the matching rename. The pin stays at
0.1.0-alpha.53.
@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Sep 16, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Sep 16, 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 Sep 16, 2026

@agentcore-devx-automation agentcore-devx-automation Bot 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.

AgentCore Harness Review

Verdict: Changes requested

Blocking: toolRuntimes isn't understood by the pinned L3 construct

src/assets/cdk/bin/cdk.ts (line 36) now passes toolRuntimes: spec.toolRuntimes into the vended CDK stack, but the CDK stack depends on @aws/agentcore-cdk@0.1.0-alpha.53 (per src/assets/cdk/package.json), which still expects mcpRuntimeTools:

  • AgentCoreMcpSpecSchema in the published package declares mcpRuntimeTools and is .strict().
  • AgentCoreMcp (L3) reads mcpSpec.mcpRuntimeTools in two places to create runtimes and wire references.

Because resolveMcpSpec is typed via SpecWithLatestFields = any, the compiler won't catch this. At synth time the L3 will just see mcpRuntimeTools === undefined, so any tool runtimes a user declares in agentcore.json will be silently dropped from the deployed stack (no error, no output).

Looking at the sibling aws/agentcore-l3-cdk-constructs repo, there's no matching rename there either, so this can't work end-to-end as-is.

Options to fix:

  1. Land the same rename in agentcore-l3-cdk-constructs, publish a new @aws/agentcore-cdk version, and bump the pin in src/assets/cdk/package.json (and update sync-vended-cdk.ts's pinned tag if needed) before or in this PR.
  2. Keep the on-the-wire field name to the L3 as mcpRuntimeTools for now — i.e. in resolveMcpSpec, emit mcpRuntimeTools: spec.toolRuntimes — and only flip the L3-facing name once the construct package is updated.

Either way, please also add an assertion (e.g. in src/assets/cdk/test/cdk.test.ts) that a spec with a populated toolRuntimes actually produces the corresponding AWS::BedrockAgentCore::Runtime (or whichever) resource, so this regression would fail synth-level tests instead of silently dropping resources.

Non-blocking but worth confirming: hard break of existing agentcore.json files

ProjectSpecSchema is .strict() and the new test in src/projectSchemas/project.test.ts explicitly asserts that the old mcpRuntimeTools key is rejected. Any existing user project on disk will now fail to load with no migration or alias. That's presumably intentional for a pre-1.0 alpha, but worth calling out in the release notes / changelog — and consider whether a one-release deprecation window (accept both keys, warn on the old one) is worth the ~10 lines of code given that the CLI is already published.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 16, 2026
@codecov-commenter

codecov-commenter commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.03%. Comparing base (363bfb2) to head (60e53b7).

Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2315      +/-   ##
============================================
- Coverage     97.03%   97.03%   -0.01%     
============================================
  Files           584      584              
  Lines         39865    39862       -3     
============================================
- Hits          38682    38679       -3     
  Misses         1183     1183              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tejaskash
tejaskash marked this pull request as ready for review September 16, 2026 18:26
…olRuntimes

The Inspector SPA reads this field. The pinned @aws/agent-inspector still
reads mcpRuntimeTools, so the Resources panel shows no tool runtimes until
the Inspector rename publishes and the pin is bumped.
@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Sep 16, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 16, 2026
@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Sep 16, 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 Sep 16, 2026
@tejaskash
tejaskash merged commit 3219d05 into refactor Sep 16, 2026
20 of 21 checks passed
@tejaskash
tejaskash deleted the feat/tool-runtimes-key branch September 16, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants