feat(project): rename mcpRuntimeTools to toolRuntimes in agentcore.json - #2315
Conversation
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.
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
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:
AgentCoreMcpSpecSchemain the published package declaresmcpRuntimeToolsand is.strict().AgentCoreMcp(L3) readsmcpSpec.mcpRuntimeToolsin 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:
- Land the same rename in
agentcore-l3-cdk-constructs, publish a new@aws/agentcore-cdkversion, and bump the pin insrc/assets/cdk/package.json(and updatesync-vended-cdk.ts's pinned tag if needed) before or in this PR. - Keep the on-the-wire field name to the L3 as
mcpRuntimeToolsfor now — i.e. inresolveMcpSpec, emitmcpRuntimeTools: 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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
…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.
|
Claude Security Review: no high-confidence findings. (run) |
Renames the
agentcore.jsonkeymcpRuntimeToolstotoolRuntimes, 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
mcpRuntimeToolsfails withUnrecognized key: "mcpRuntimeTools". Rename the key by hand.Also fixes the tool runtime schema, which required
artifactwhere the L3 usesbuild, so no tool runtime ever validated (since #1992).Until the next RC bump of
@aws/agentcore-cdkand@aws/agent-inspector, tool runtimes do not synthesize and the Inspector panel shows none. Accepted.Testing
bun testpass. New schema test covers the new key and the rejected old one.toolRuntimesentry, build, deploy, status, invoke, negative check of the old key, teardown.