mcp server crashed 14 times yesterday because agent sent tool args as string instead of object
running an mcp postgres server (version 0.4.2) and the agent keeps sending tool args like {"query": "{\"table\": \"users\", \"limit\": 10}"} instead of {"query": {"table": "users", "limit": 10}}. server tries to parse the string as json, fails, crashes. added validation that checks if args is a string and tries to json.loads() it before processing, but that feels like a hack. the real issue is the agent is serializing the args object to a string somewhere in the chain and we can't figure out where. anyone else seeing this pattern with mcp servers and is there a better fix than just parsing strings on the server side?
ouch. are you validating the args against a schema on the server side before trying to parse them? we added json schema validation last month and it cut our crashes from ~12/day to maybe 1. what mcp server specifically?