Install
openclaw skills install @alinklab/mathematicsMCP Mathematics 是一个全面的数学计算服务器,可将任何AI助手转变为强大的数学计算引擎,提供高级数学函数、单位转换和财务计算等功能。
openclaw skills install @alinklab/mathematicsMCP Mathematics 是一个全面的数学计算服务器,可将任何AI助手转变为强大的数学计算引擎,提供高级数学函数、单位转换和财务计算等功能。
此 Skill 必须配置 API 密钥才能使用。
.env 中没有 XBY_APIKEY,必须使用 AskUserQuestion 工具向用户询问 API 密钥scripts.config.set_api_key(api_key) 保存,然后继续处理你(大模型)是路由层,负责理解用户意图、选择工具、提取参数。代码只负责调用API。
用户输入 → 你选择工具 → 提取该工具需要的参数 → 调用 scripts.tools 中的函数 → 返回结果给用户
scripts.config.settings.api_key 为空,使用 AskUserQuestion 询问用户,拿到后调用 scripts.config.set_api_key(key) 保存scripts.tools 中的函数,例如 scripts.tools.search_schools(score='520', province='北京', category='综合')raw 数据整理后展示给用户根据用户意图选择对应的工具函数:
| 用户意图 | 工具函数 |
|---|---|
| Get performance metrics | scripts.tools.performance_metrics |
| Get security status | scripts.tools.security_status |
| Get memory statistics | scripts.tools.memory_statistics |
| Evaluate math expression | scripts.tools.calculate_expression |
| Batch calculate expressions | scripts.tools.batch_calculate |
| Calculate statistics | scripts.tools.calculate_statistics |
| Matrix operations | scripts.tools.matrix_operation |
| Unit conversion | scripts.tools.convert_units |
| Natural language conversion | scripts.tools.convert_natural_language |
| Number theory operations | scripts.tools.analyze_number_theory |
| Create session | scripts.tools.create_session |
| Session calculation | scripts.tools.session_calculate |
| List session variables | scripts.tools.list_session_variables |
| Delete session | scripts.tools.delete_session |
| Get calculation history | scripts.tools.get_calculation_history |
| Clear history | scripts.tools.clear_history |
| Optimize memory | scripts.tools.optimize_memory |
| List functions | scripts.tools.list_functions |
如果参数不完整,使用 AskUserQuestion 向用户询问缺失的参数。
工具描述:Get performance metrics
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具描述:Get security status
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具描述:Get memory statistics
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具描述:Evaluate math expression
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| expr | string | true | Mathematical expression to evaluate |
工具描述:Batch calculate expressions
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| expressions | array | true | List of mathematical expressions to evaluate |
工具描述:Calculate statistics
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| data | array | true | List of numbers to analyze | |
| operation | string | true | Statistical operation (mean, median, mode, stdev, etc.) |
工具描述:Matrix operations
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| matrices | array | true | List of matrices for operation | |
| operation | string | true | Matrix operation (multiply, determinant, inverse) |
工具描述:Unit conversion
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| value | number | true | Numeric value to convert | |
| from_unit | string | true | Source unit | |
| to_unit | string | true | Target unit | |
| unit_type | string | true | Unit category (length, mass, time, temperature, etc.) |
工具描述:Natural language conversion
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| query | string | true | Natural language conversion request |
工具描述:Number theory operations
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| number | integer | true | Integer to analyze | |
| operation | string | true | Number theory operation (is_prime, prime_factors, divisors, totient) |
工具描述:Create session
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| session_id | null | false | Optional session identifier | |
| variables | null | false | Initial session variables |
工具描述:Session calculation
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| session_id | string | true | Session identifier | |
| expr | string | true | Mathematical expression to evaluate | |
| var_name | null | false | Variable name to store result |
工具描述:List session variables
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| session_id | string | true | Session identifier |
工具描述:Delete session
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| session_id | string | true | Session identifier |
工具描述:Get calculation history
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| limit | integer | false | 10.0 | Number of recent calculations to retrieve |
工具描述:Clear history
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具描述:Optimize memory
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具描述:List functions
| 参数名称 | 参数类型 | 是否必填 | 默认值 | 描述 |
|---|
工具函数返回 dict 对象:
result["raw"] - API 原始返回数据(JSON),直接将此数据整理后展示给用户result["success"] - 是否成功(True/False)result["message"] - 状态消息xiaobenyang_gaokao_skill/
├── scripts/
│ ├── __init__.py
│ ├── config.py # 配置管理 + set_api_key()
│ ├── call_api.py # API 客户端 + call_api()
│ └── tools.py # 工具函数(直接调用)
├── requirements.txt
└── SKILL.md