The issue is in how the agent is calling the wait_for_mentions tool and how the framework is processing the input. Here’s what’s happening:
The agent is trying to format the input as a JSON string: “{"timeoutMs": 60000}”
However, when this gets processed by the CrewAI framework, it’s being parsed and converted into a Python dictionary with a float value: {‘timeoutMs’: 60000.0}
The framework is then passing this as a keyword argument (kwargs) to the wait_for_mentions function
When this gets serialized again to send to the MCP server, it becomes {“timeoutMs”:60000.0} with a float value
The MCP server is strictly expecting an integer and rejects the float value with the error: Unexpected symbol ‘.’ in numeric literal at path: $.timeoutMs
the tool is actually taken from MCP server (our agent to agent protocol) in which wait for mention tool will be responsible for making the agent wait so that other agent can tell it what to do and the parameter
this is the code in our Protocol which is providing this tool to the agent :
fun CoralAgentIndividualMcp.addWaitForMentionsTool() {
addTool(
name = “wait_for_mentions”,
description = “Wait until mentioned. Call this tool when you’re done or want to wait for another agent to respond. This will block until a message is received. You will see all unread messages.”,
inputSchema = Tool.Input(
properties = buildJsonObject {
putJsonObject(“timeoutMs”) {
put(“type”, “number”)
put(“description”, “Timeout in milliseconds (default: $maxWaitForMentionsTimeoutMs ms)”)
}
},
required = listOf(“timeoutMs”)
)
) { request: CallToolRequest →
handleWaitForMentions(request)
// delay(10000)
}
}
Looks like your code there is Kotlin. The issue you’re hitting isn’t a CrewAI thing (on the client side), but more likely something on your Kotlin server’s end.
In that snippet, you’re setting up a JSON Schema, and timeoutMs is defined like:
put("type", "number")
Now, according to the JSON Schema docs, number accepts any numeric type, either integer or floating. So, if your server is only expecting an integer, you need to change that to: