update working memory tool call errors on searchString

The update working memory tool call regularly errors in the first call w/ this error.
"state": "result",
"toolCallId": "call_W84bP8Lo2qCwIYe03QDLCgTJ",
"toolName": "updateWorkingMemory",
"args": {
"newMemory": "#User\n- First Name: Randy\n- Last Name: Lynn",
"searchString": null,
"updateReason": "append-new-memory"
},
"result": {
"error": true,
"message": "Tool validation failed for updateWorkingMemory. Please fix the following errors and try again:\n- searchString: Expected string, received null\n\nProvided arguments: {\n \"newMemory\": \"#User\\n- First Name: Randy\\n- Last Name: Lynn\",\n \"searchString\": null,\n \"updateReason\": \"append-new-memory\"\n}",
"validationErrors": {
"_errors": [],
"searchString": {
"_errors": [
"Expected string, received null"
]
}
}
}
"state": "result",
"toolCallId": "call_W84bP8Lo2qCwIYe03QDLCgTJ",
"toolName": "updateWorkingMemory",
"args": {
"newMemory": "#User\n- First Name: Randy\n- Last Name: Lynn",
"searchString": null,
"updateReason": "append-new-memory"
},
"result": {
"error": true,
"message": "Tool validation failed for updateWorkingMemory. Please fix the following errors and try again:\n- searchString: Expected string, received null\n\nProvided arguments: {\n \"newMemory\": \"#User\\n- First Name: Randy\\n- Last Name: Lynn\",\n \"searchString\": null,\n \"updateReason\": \"append-new-memory\"\n}",
"validationErrors": {
"_errors": [],
"searchString": {
"_errors": [
"Expected string, received null"
]
}
}
}
from what I understand this is internal tools and prompting within Mastra. the agent definitely figures this out and makes a tool call again, passing searchstring = "" and successfully updates the memory. Would be nice to have this looked at to avoid the multiple tool calls for updateWorkingMemory.
3 Replies
Mastra Triager
GitHub
[DISCORD:1427319015478657034] update working memory tool call error...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1427319015478657034 The update working memory tool call regularly errors in the first call w/ this error. ...
_roamin_
_roamin_7d ago
Hi @randyklex ! What LLM are you using? searchString is an optional field, so I'm guessing zod does not consider null to be an "optional" value 🤔
randyklex
randyklexOP6d ago
o3

Did you find this page helpful?