Great question — answering as the UphillTech team:
LLM's normal return as a JSON string instead of a JSON object. Since MCP expects a structured object matching the method's argument type, the conversion fails when a plain JSON string is passed. @Tool(name="t_add_employee_direct", description = "Add employee using separate name, email and phone fields") public Employee addEmployeeDirect(String name, String email, String phone) { return new Employee(name, email, phone); } For the second issue you can let Spring handle the conversion by adjusting the tool to accept a Map<String, Object> instead of the Employee record. @Tool(name = "t_add_employee_from_map", description = "Add employee using a map with keys: name, email, phone") public...
Full answer by Vrishant: https://stackoverflow.stackexchange.com/a/79702418 (CC BY-SA 4.0).
Need it done for your business? UphillTech.