Math & Numbers
对有理函数 F(x) = N(x)/D(x) 做部分分式分解(分母次数 ≤ 6,分子次数 ≤ 8,假分式自动先做多项式长除):Durand-Kerner 求分母根并按重数/共轭对分组,解多项式系数线性方程组得到 A/(x−r)^j 与 (Bx+C)/((x−α)²+β²) 形式的分解,并在代数探针点做数值残差验证。经典例:(3x+5)/(x²+3x+2) = 2/(x+1) + 1/(x+2);(x³+2x)/(x²+1) = x + x/(x²+1);1/(x(x+1)²) = 1/x − 1/(x+1) − 1/(x+1)²。
用三种语言从你的代码中调用此工具。
curl -X POST 'http://127.0.0.1:3003/zh/api/tools/partial-fraction-decomposer' \
-H 'Content-Type: application/json' \
-d '{"numCoeffs":"5,3","denCoeffs":"2,3,1","decimalPlaces":4}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST http://127.0.0.1:3003/zh/api/tools/partial-fraction-decomposer| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| numCoeffs | text | 是 | Comma-separated numerator coefficients, constant term first, degree ≤ 8, e.g. 5,3 → 3x + 5. |
| denCoeffs | text | 是 | Comma-separated denominator coefficients, constant term first, degree 1–6, e.g. 2,3,1 → x² + 3x + 2. |
| decimalPlaces | number | 否 | — |
文本结果
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-partial-fraction-decomposer": {
"name": "partial-fraction-decomposer",
"description": "对有理函数 F(x) = N(x)/D(x) 做部分分式分解(分母次数 ≤ 6,分子次数 ≤ 8,假分式自动先做多项式长除):Durand-Kerner 求分母根并按重数/共轭对分组,解多项式系数线性方程组得到 A/(x−r)^j 与 (Bx+C)/((x−α)²+β²) 形式的分解,并在代数探针点做数值残差验证。经典例:(3x+5)/(x²+3x+2) = 2/(x+1) + 1/(x+2);(x³+2x)/(x²+1) = x + x/(x²+1);1/(x(x+1)²) = 1/x − 1/(x+1) − 1/(x+1)²。",
"baseUrl": "http://127.0.0.1:3003/mcp/sse?toolId=partial-fraction-decomposer",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "partial-fraction-decomposer",
"arguments": {
"numCoeffs": "5,3",
"denCoeffs": "2,3,1",
"decimalPlaces": 4
}
}
}有问题或反馈?请联系 [email protected]