Skip to content

Commit 328f74c

Browse files
lu-zeroclauderekram1-node
authored
fix(mcp): pass tool input as permission metadata (anomalyco#51062)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
1 parent 32b1a1b commit 328f74c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/core/src/tool/mcp.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const layer = Layer.effect(
5252
action: name(tool.server, tool.name),
5353
resources: ["*"],
5454
save: ["*"],
55-
metadata: {},
55+
metadata: { input: input ?? {} },
5656
sessionID: context.sessionID,
5757
agent: context.agent,
5858
source: {

‎packages/core/test/mcp.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2513,15 +2513,15 @@ it.effect("waits for permission before calling an MCP tool", () =>
25132513
type: "tool-call",
25142514
id: "call_mcp_permission",
25152515
name: "execute",
2516-
input: { code: "return await tools.demo.search({})" },
2516+
input: { code: 'return await tools.demo.search({ query: "open issues" })' },
25172517
},
25182518
})
25192519
.pipe(Effect.forkScoped)
25202520
expect(yield* Deferred.await(assertion)).toEqual({
25212521
action: "demo_search",
25222522
resources: ["*"],
25232523
save: ["*"],
2524-
metadata: {},
2524+
metadata: { input: { query: "open issues" } },
25252525
sessionID: Session.ID.make("ses_mcp_permission"),
25262526
agent: toolIdentity.agent,
25272527
source: {

0 commit comments

Comments
 (0)