How Do I Enable the MCP Tool to Support High-Precision Numeric Parameters?
Symptom
After an MCP server is configured in CodeArts Agent, calling an API via the MCP protocol returns a parameter value that does not match the actual input value.
Cause Analysis
CodeArts Agent does not have a built-in high-precision number processing mechanism. Numbers that exceed the safe integer range will lose precision during JSON parsing.
Solution
On the MCP server, it is recommended that the string type be used to transfer high-precision numbers. That is, set the JSON schema type of high-precision number parameters to string.
{
"inputSchema": {
"type": "object",
"properties": {
"amount": {
"type": "string",
"description": "Amount in wei (high-precision integer as decimal string, e.g., '1000000000000000000')"
}
}
}
} Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot