You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DurableAgent rejects MCP dynamic tools that have no validate function on inputSchema #1576
DurableAgent.executeTool() in @workflow/ai@4.1.0-beta.59 incorrectly rejects tool calls for MCP dynamic tools whose inputSchema (created via jsonSchema() from @ai-sdk/provider-utils) has no validate function.
Reproduction
Use @ai-sdk/mcp to create MCP tools (which produces dynamicTool with jsonSchema() wrapper — no validate fn), then pass them to a DurableAgent. When the model calls any of these tools, the agent throws:
Error: Invalid input for tool "toolName": undefined
constinput=awaitschema.validate?.(JSON.parse(toolCall.input||'{}'));if(input!==undefined&&!input.success){// validation ran and failedthrownewError(...);}parsedInput=input?.value??JSON.parse(toolCall.input||'{}');
Or, match the AI SDK pattern:
constparsed=JSON.parse(toolCall.input||'{}');if(typeofschema.validate==='function'){constinput=awaitschema.validate(parsed);if(!input.success){thrownewError(`Invalid input for tool "${toolCall.toolName}": ${input.error?.message}`);}parsedInput=input.value;}else{parsedInput=parsed;}
Environment
@workflow/ai: 4.1.0-beta.59
ai: 6.0.142
@ai-sdk/mcp: 1.0.30
@ai-sdk/provider-utils: 4.0.21
@modelcontextprotocol/sdk: 1.29.0
Workaround
Patch a passthrough validate onto MCP tool schemas before passing them to DurableAgent:
if(schema&&typeofschema.validate!=="function"){schema.validate=(value: unknown)=>({success: true, value });}
Still reproduces on @workflow/ai@^6.0.0 (with ai@6.0.175, @ai-sdk/mcp@^1.0.42). Every MCP tool call surfaced via @ai-sdk/mcp fails before executing with:
Error: Invalid input for tool "notion__notion_search": undefined
Looks like this issue was mentioned in #12165 which ships a new WorkflowAgent. I guess DurableAgent won't be patched?
Activity
wasimxyz commentedon Jun 22, 2026
Still reproduces on
@workflow/ai@^6.0.0(withai@6.0.175,@ai-sdk/mcp@^1.0.42). Every MCP tool call surfaced via@ai-sdk/mcpfails before executing with:Looks like this issue was mentioned in #12165 which ships a new
WorkflowAgent. I guessDurableAgentwon't be patched?