mathematica-skill
Runs the full pipeline against the Wolfram kernel — plan, build, evaluate, export, and verify — while detecting kernel/license/frontend availability via a doctor check, and enforces validation boundaries that prevent claiming verified results without a real Wolfram run.
Generates, lints, executes, and verifies Wolfram Language code (Integrate, DSolve, NDSolve, NMinimize, Plot, Export, etc.), including lexer/bracket checks and blocked-call safety policy, with language-following notebook editing and figure theming.
Drives a licensed local Wolfram Mathematica kernel and notebook frontend to perform real symbolic/numeric computation, generate genuine executable .nb notebooks, and export native PNG/PDF/CSV/XLSX artifacts, with independent re-computation for verification and whitelisted delivery.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mathematica-skillintegrate sin(x)^2 from 0 to pi and export it as a native .nb notebook"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mathematica-skill
让 Agent 真正控制 Mathematica 干活,而不是生成看起来像结果的图片。
一套本地优先的 Mathematica / Wolfram Language 自动化系统:CLI + MCP + Agent Skill 三入口,负责
从自然语言或作业材料,到可运行的 .nb、原生 PNG/PDF、数据文件,再到独立复算验收的整条链路。
需求 → 计划 → Wolfram Language → 原生执行 → 原生出图 → 复算对账 → 白名单交付1. 为什么需要它
大多数所谓「Mathematica AI 工具」止步于生成代码片段或者一张相似图:
生成
.nb但打开后只有文字,没有可执行单元;用 Python 画一张图,塞进 Notebook 冒充 Wolfram 输出;
声称「已验证」,实际没有运行过一次;
换个机器打开就报路径不存在;
交付出一个装满
.py、.json、日志、截图的目录。
这个项目的存在理由就是把这些做法逐条堵死。
Related MCP server: mma-mcp
2. 开发理念
2.1 真实计算,不允许替代
所有数学结果必须来自有许可证的 Wolfram 内核:
符号推导、数值积分、方程求解、优化、统计、动力学、随机过程 →
Integrate/DSolve/NDSolve/NMinimize/LinearModelFit/RandomVariate…图形 →
Plot/ListLinePlot/ParametricPlot3D/Graphics/Graphics3D/ArrayPlot, 由Rasterize+Export原生导出。
Python 只做四件事:调度进程、复制文件、检查产物、比较数值。它不碰最终数学,也不重绘最终图。
2.2 Notebook 必须是真的
.nb 由 Mathematica 自己的解析器和导出器生成;执行由真实前端完成:
NotebookOpen → NotebookEvaluate[InsertResults → True] → NotebookSave → NotebookClose → 重新打开代码单元保存的是源码原文,所以注释、缩进、空行都在;不是把文字塞进 Text 单元冒充代码。
2.3 没有证据就不许说通过
verified 只有一条路径能拿到:
内核真的算出 checks;
前端真的打开、执行、保存、重新打开;
新进程独立复算,逐项一致;
PNG 尺寸正确、非空白、文件完整;
交付目录只有白名单文件。
缺一项就是 draft / blocked,报告里写清楚缺什么。
2.4 交付与内部分离
work/<run>/ ← 内部:任务副本、日志、两轮对比、验证报告
└── deliver/<name>/ ← 客户:.nb + 必要 .wl + PNG/PDF/CSV/XLSX内部目录永不进入客户目录;客户目录里永不出现 Python、JSON、日志、截图。
2.5 跨平台,但不说谎
macOS Apple Silicon 是主要验收平台;Windows / Linux 的路径、进程、编码都做了适配, 但只有真的跑过才有资格写「已验证」。兼容性表见 COMPATIBILITY.md。
3. 达到的效果
能力 | 具体表现 |
任务解析 | 从题目、旧 |
代码质量 | 括号/字符串/注释词法检查 + 危险调用策略检查,默认阻断 |
原生计算 | 真实内核执行,捕获 |
Notebook | 真正的 Input 单元、真实 Output、可重开可再算 |
改 Notebook |
|
语言跟随 |
|
图形 | 1600×900 / 4K / A4-300dpi 预设,等比缩放补白,不拉伸 |
数据 | CSV / XLSX / JSON 原生 |
复算 | 两次独立进程,逐项数值/符号比较,容差写在任务里 |
图面检查 | 尺寸、空白、单色、文件完整性(只读,不重绘) |
报告 |
|
交付 | 白名单目录 + SHA-256 manifest,可核对 |
安装 | npx / npm / pip 三种入口,装完即用; |
快速计算 |
|
MCP | 11 个 |
Skill | 符合 Agent Skills frontmatter,可装到 Claude / Codex / Cursor / OpenCode 等 |
4. 安装(三种入口,装完即用)
npx mathematica-skill doctor --frontend # 不安装,直接用
npm i -g mathematica-skill # 全局安装
pip install mathematica-skill # Python 方式三条命令行为完全一致:同一套调度层、同一批 Wolfram 脚本、同一个 Skill。
npm 包里已经带上 Python 源码与 wolfram/,不需要再 pip install 一次。
详见 docs/INSTALL.md。
Claude 桌面版(macOS / Windows)
mathematica-skill install --mcp-client claude-desktopmacOS 写入
~/Library/Application Support/Claude/claude_desktop_config.json,Windows 写入%APPDATA%\Claude\claude_desktop_config.json。写入后需要完全退出并重新打开 Claude 桌面版,配置只在启动时读取。
推荐先
npm i -g mathematica-skill或pip install再执行。npx的包目录在临时缓存里,缓存被清理后配置会失效。配置里会带上
PYTHONPATH(源码或 npm 安装时)和PYTHONUTF8,因为 GUI 宿主不经过 npm 包装脚本。
mathematica-skill doctor --frontenddoctor 会回答三个问题:有没有内核、许可证能不能用、有没有 Notebook 前端。
# 生成一个示例任务并完整跑一遍
mathematica-skill example --write task.json
mathematica-skill plan task.json
mathematica-skill run task.json --out work --seed 20261031产物:
work/<run>/deliver/<name>/
├── sine-and-its-integral.nb # 真实 Notebook,带 Output
└── sine.png # Wolfram 原生导出的 1600×900没有 Mathematica 的机器:
mathematica-skill run task.json --allow-draft # 只生成 draft,verified 永远 false
mathematica-skill build task.json --draft --out build/5. 任务格式
task.json 是 Agent 与内核之间唯一的契约。
{
"schema_version": "1.0",
"title": "Logistic map and Lyapunov exponent",
"language": "zh",
"seed": 20261031,
"assumptions": ["r = 4 处于完全混沌区", "跳过前 1000 步瞬态"],
"sources": ["data/series.csv"],
"tasks": [
{
"id": "logistic",
"prompt": "计算 r = 4 时 Logistic 映射的 Lyapunov 指数并画出轨道。",
"code": "orbit = NestList[4. # (1 - #) &, 0.123456, 5000];\nlyap = Mean[Log[Abs[4. (1 - 2 Most[orbit])]]];\nfig = ListLinePlot[orbit[[1 ;; 300]], Frame -> True];",
"checks": [
{"id": "lyap_value", "kind": "numeric", "expression": "lyap", "expected": 0.6931,
"abs_tol": 0.01, "description": "r=4 时理论值 ln2"},
{"id": "orbit_length", "kind": "numeric", "expression": "Length[orbit]", "expected": 5001}
]
}
],
"outputs": [
{"id": "orbit_fig", "task": "logistic", "kind": "figure", "filename": "orbit.png",
"expression": "fig", "width": 3840, "height": 2160, "dpi": 300, "title": "Logistic 轨道"}
],
"delivery": {"name": "logistic-delivery", "include": ["orbit_fig"]},
"metadata": {"deliver_code": false}
}规则:
code必须是能跑的 Wolfram Language,不写伪代码。checks必须给可比较的expected和容差;没检查就等于没验证。至少要有一条,否则run在进入内核之前以CHECKS_EMPTY拦下。outputs[].expression必须在前面的代码里算过。sources只能是相对路径,运行时会复制进隔离目录。delivery.include决定哪些 output 进客户目录。
完整字段说明见 docs/CLI.md 与 mathematica_skill/models.py。
6. 命令一览
命令 | 作用 |
| 内核 / 许可证 / 前端 / AgentTools 探测,支持 |
| 只解析任务,输出计划,不启动内核 |
| 词法 + 危险调用静态检查 |
| 完整流水线,产出 verified 交付或明确的失败状态 |
| 只生成 |
| 用前端执行一个已有 |
| 快速执行一段 Wolfram 代码,返回结果与消息;不做交付,永远 |
| 从真实表达式导出 PNG/PDF/CSV/XLSX |
| 干净内核执行 checks,可与上一轮比较 |
| Skill 安装与 MCP 配置,支持 |
| 输出可运行的任务 JSON |
| 修改既有 |
| 启动 MCP stdio 服务 |
7. MCP 工具
mathematica_doctor mathematica_plan mathematica_lint
mathematica_build mathematica_run mathematica_compute
mathematica_evaluate_notebook mathematica_edit_notebook mathematica_export
mathematica_verify mathematica_examplemathematica_compute 接受 code 或 code_path,可选 working_dir(Import 相对路径的基准)和 figure_path(结果是图形时复制出 PNG)。它只回答「内核算出了什么」,不做 checks 与复算,返回值里 verified 永远是 false;要交付请用 mathematica_run。
全部返回结构化 JSON 文本;内部错误也是 JSON,isError: true,不抛栈给客户端。
工具名前缀 mathematica_,不会和官方 Wolfram MCP 冲突。
接入方式:
mathematica-skill install --mcp-client claude
mathematica-skill install --mcp-client codex
mathematica-skill install --mcp-client opencode
mathematica-skill install --mcp-client cursor --config ~/.cursor/mcp.json安装器只合并自己的那一个键,不覆盖其他 MCP;已存在时提醒用 --force。
8. 目录结构
mathematica-skill/
├── mathematica_skill/ # Python 调度层(只做 I/O、进程、校验)
├── wolfram/ # 原生侧:Notebook 构建/执行/导出/验证 + 方法库 + 绘图主题
├── skills/mathematica-native # Agent Skill:SKILL.md + references
├── examples/ # 可运行任务示例(含故意失败的样本)
├── tests/ # 单元 / 集成 / 回归
├── bin/ # npx / npm 入口(薄包装,调用同一套 Python)
├── docs/ # 安装、架构、CLI、验证、安全、macOS
└── .github/workflows/ # 静态检查与测试8.1 语言跟随与 Notebook 修改
language 写 auto 时按材料判断:
题目(
prompt/notes/subject/ 标题 / 假设)里汉字 >= 8 且占比 >= 15% → 中文,否则英文。题目判不出来时看
sources里的.nb:先解码\:xxxx形式的 7-bit 转义,再比较 「中文片段 vs 英文句子」的占比(>= 25%),所以英文作业里引用一句中文不会翻转语言。代码字符串(含
[]{};=<>|&_$)不算英文正文,代码很多的中文作业仍判中文。图内文字同步换字体:macOS 用 PingFang SC,Windows 用微软雅黑,Linux 用 Noto Sans CJK; 无前端时按平台约定顺序挑,不会在 Linux 上写死 macOS 字体。
修改既有 Notebook:
mathematica-skill edit 旧作业.nb --edits edits.json --out 新作业.nb
mathematica-skill edit 旧作业.nb --op "replace_cell:4=sol = DSolveValue[...];" --in-place
mathematica-skill edit 旧作业.nb --language zh --out 中文版.nb写入由 Mathematica 完成(Export[..., "NB"]),随后脚本重新导入核对每个字符串,
Python 再校验 UTF-8 与 U+FFFD。任何字符丢失都判失败,不会交付乱码文件。
编辑细节:
不给
--out时写同目录<名字>-edited.nb;已存在则自动加-2、-3,不静默覆盖。--in-place才覆盖源文件,且先写<名字>.nb.<时间戳>.bak(同秒重名自动加序号)。内部工作目录用系统临时目录,成功后自动清理,不在用户目录留
_edit/。--edits不能和--op/--title/--language混用,混用直接报错而不是静默忽略。
9. 验证边界(必读)
环境 | 能证明什么 |
无 Mathematica | 只能生成 draft; |
有内核无前端 | 能算 |
内核 + 前端 | 完整链路;仍需独立复算通过 |
只在 Linux 跑过 | 不能声称 macOS/Windows 已验证 |
compute 不在上表的交付路径里:它只回答「内核算出了什么」,verified 永远为 false。
tests/native 里的测试是这张表「有内核 + 前端」一行的实际证据;没有运行过就不算。
审查者只需看两样东西:_validation/validation.json 的 findings,以及 native 段里的
frontend_used / output_cells / failed_outputs。
10. 安全
任务代码视为不可信:
Run、RunProcess、URL*、本机绝对路径、LibraryLoad默认阻断。--allow-external只把阻断降级为 warning,并写进报告。不上传题目、数据、Notebook;所有计算本地完成。
不内置、不分享激活信息;许可证不可用就停。
细节见 skills/mathematica-native/references/security.md。
11. 开发
python3 -m pip install -e .
python3 -m pytest -q # 单元测试(不需要 Mathematica)
python3 scripts/check.py # 词法检查 + WL 括号平衡 + 测试
python3 -m pytest tests/native -m native -ra # 装有 Mathematica 的机器上跑真实验收(无许可证会 skip)需要真实内核的测试标记为 @pytest.mark.native,在普通 CI 上跳过,不会假装通过。
发布前:
python3 scripts/check.py && git tag v0.1.012. 许可
MIT,见 LICENSE。Wolfram Mathematica 本身是商业软件,本项目不包含、不修改、不绕过其授权。
English: README.en.md
Available Tools
11 toolsmathematica_buildC
生成原生 .nb 和 .wl;draft=true 时不要求 Mathematica。
| Name | Required | Description | Default |
|---|---|---|---|
| draft | No | ||
| out_dir | No | ||
| timeout | No | ||
| task_path | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It usefully discloses that draft mode avoids a Mathematica dependency, but it does not say whether files are overwritten, what outputs are produced, what task_path expects, or how timeout/out_dir affect behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very short and front-loaded: artifact types first, then the key draft exception. It avoids waste, though the extreme terseness leaves necessary context unstated.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a four-parameter build tool with no annotations and no output schema, the description is too sparse. It should explain inputs, output artifacts, and side effects beyond the draft-mode note.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It only partially explains draft=true and does not clarify task_path, out_dir, or timeout, leaving three of four parameters undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action and concrete artifacts: generate native .nb and .wl files. This is clearer than a tautology and gives the agent the resource type, but it does not explicitly distinguish the tool from siblings such as mathematica_export or mathematica_run.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The only guidance is that draft=true does not require Mathematica. There is no explanation of when to choose this tool instead of mathematica_run, mathematica_export, or other siblings, nor are there exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mathematica_computeA
在真实 Wolfram 内核里执行一段代码,返回最后一个表达式的值和消息;图形结果可导出 PNG。快速计算,不做 checks、Notebook 和复算,因此永远 verified=false;可交付成果请用 mathematica_run。
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Wolfram Language 代码,最后一个表达式的值即结果 | |
| out_dir | No | 内部工作目录根路径 | |
| timeout | No | ||
| code_path | No | 代码文件路径,与 code 二选一 | |
| figure_path | No | 结果是图形时复制出 PNG 的目标路径(.png) | |
| working_dir | No | Import 相对路径时的基准目录 | |
| allow_external | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it says no checks, no notebook, no re-computation, and that results are always verified=false, which prevents an agent from treating output as validated. It also states the default timeout/allow_external indirectly and the PNG export behavior. What is left undisclosed is kernel state isolation (whether prior calls persist) and side effects, which matter for a compute tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, each carrying distinct information: sentence one states the action and output, sentence two states the constraints and the alternative. The most decision-relevant fact (verified=false) is placed before the routing hint, and nothing is repeated from the schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 7-parameter, no-annotation, no-output-schema tool, the description covers purpose, output shape, validation status, and the sibling alternative. It falls short on kernel/session state and error behavior, but nothing critical for a correct first invocation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 71%, so the schema already documents most of the 7 parameters, including the `code`/`code_path` pairing and `figure_path`. The description's only parameter-level value is confirming that a figure result can be written to PNG; it says nothing extra about `timeout`, `allow_external`, `working_dir`, or `out_dir`. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource ("在真实 Wolfram 内核里执行一段代码"), the return semantics ("返回最后一个表达式的值和消息"), and the side-output capability ("图形结果可导出 PNG"). It also names the sibling `mathematica_run` as the alternative for deliverables, so an agent can tell the two apart without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly gives the condition that selects the alternative: "可交付成果请用 mathematica_run", which covers the main routing decision. It does not address the other plausible alternatives (`mathematica_evaluate_notebook`, `mathematica_export`), so the exclusion is not fully complete.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mathematica_doctorC
检测 Wolfram 内核、许可证、前端和 wolframscript。
| Name | Required | Description | Default |
|---|---|---|---|
| frontend | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden, and it discloses almost nothing: it does not state that the operation is read-only/non-mutating, whether it can hang or take long (probing a license server), or what it reports on failure. Naming the four subsystems it probes is the only real behavioral content.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single short sentence, front-loaded with the verb and the probed targets, with no filler. It is efficiently structured, though its brevity is partly under-specification rather than true conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no annotations, no output schema, and an undocumented parameter, the definition should say what a check run reports (per-subsystem pass/fail?) and what the `frontend` flag does. Neither is present, so an agent cannot predict the result shape or the cost of the call.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must explain the single `frontend` boolean, and it does not — it only lists 前端 as one of the checked subsystems, leaving the agent to guess that the flag toggles whether the frontend probe runs (and that it defaults to false). That is a meaningful gap on the only input the tool has.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a specific verb (检测 / inspect) and enumerates the concrete targets: Wolfram kernel, license, frontend, and wolframscript. That is far clearer than the bare name 'doctor', and no sibling tool (plan, lint, build, run, compute, etc.) overlaps with environment diagnostics, so differentiation is implicit rather than stated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied: an agent can infer this is the pre-flight/troubleshooting check to run when the environment may be misconfigured. There is no explicit 'use when...', no statement of when it is unnecessary, and no pointer to any related sibling.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mathematica_edit_notebookA
在既有 .nb 上做定点修改(替换/插入/追加单元、改标题、翻转标题语言),默认另存新文件,写入后回读校验编码,不会产生乱码。
| Name | Required | Description | Default |
|---|---|---|---|
| edits | No | 也可以直接内联修改指令 | |
| timeout | No | ||
| in_place | No | 覆盖源文件,会先备份 .nb.<stamp>.bak | |
| out_path | No | 输出路径;省略则写同目录 -edited.nb | |
| edits_path | No | 修改指令 JSON 路径 | |
| notebook_path | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses that output goes to a new file by default (non-destructive), and that a read-back encoding verification runs after writing to prevent mojibake. It omits permission requirements, error/failure behavior, and what the timeout governs, but the key safety and verification traits are surfaced beyond the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single dense sentence that front-loads the operation scope before the default-output and verification caveats. Efficient, with essentially no filler, though the packed parenthetical list is somewhat heavy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 6-parameter mutation tool with a nested edits object and no output schema, the description covers purpose and default output safety but leaves the actual edit-command structure and timeout behavior unexplained. Adequate but with clear gaps an agent would need to resolve by inspecting the schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 67%, so the baseline is around 3. The description reinforces the default output behavior implied by in_place/out_path, but it adds nothing about the nested edits object, edits_path, or timeout, which remain thin or undocumented in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb and resource: fixed-point edits on an existing .nb (replace/insert/append cells, change title, flip title language). This clearly separates it from siblings like evaluate_notebook or build. It stops short of naming a sibling explicitly, so a 4 rather than a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'在既有 .nb 上做定点修改' implies the use case (modifying an existing notebook rather than creating or evaluating one), and the default save-as-new-file behavior is stated. However, it never says when to prefer this over mathematica_evaluate_notebook or when not to use it, so guidance is only implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mathematica_evaluate_notebookC
用桌面前端执行已有 .nb 并返回结果。
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | ||
| out_path | No | ||
| notebook_path | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. '桌面前端' hints at a required GUI, but it doesn't disclose side effects on the notebook file, what happens on timeout, whether out_path writes/overwrites a file, or how failures surface.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One short sentence with no padding, and the key constraint (desktop frontend) is front-loaded. But the brevity comes at the cost of under-specification rather than efficiency.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no annotations, no output schema, and 0% parameter documentation, the description should do much more. It covers only the basic action and the desktop-frontend requirement, leaving timeout, output path, and return behavior entirely undocumented.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% across three parameters. The description says nothing about notebook_path, the 240s timeout default, or what out_path is for, so it adds no meaning beyond bare parameter names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a concrete verb ('执行') and resource ('已有 .nb'), plus a distinguishing qualifier ('桌面前端'), so the core action is understandable. However, it never differentiates this from siblings like mathematica_run or mathematica_compute, leaving the agent unsure which execution tool is the right one.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It implies usage for pre-existing notebook files but gives no explicit when-to-use, when-not, or alternatives among the many execution-related siblings. No prerequisites (e.g., a running desktop frontend, notebook validity) are stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mathematica_exampleA
返回一个可运行的示例任务 JSON。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations and no output schema, the description carries the full burden, and it does disclose the key behavioral fact: the returned payload is a runnable example task JSON. It says nothing about whether the example is static or parameterized, what fields the task JSON contains, or how large it is, which leaves real gaps for a tool whose entire output is opaque.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler. For a zero-parameter tool, this is exactly the right size.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple (no params, no nested objects), but with no output schema the description is the only place the return value could be characterized, and it only says 'runnable example task JSON'. A brief note on the task JSON's shape or intended follow-up (e.g. feed into mathematica_plan/run) would make it complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so there is nothing for the description to disambiguate. The baseline of 4 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb and resource: it returns a runnable example task JSON. No sibling tool (doctor/plan/lint/build/run/compute/notebook/export/verify) does this, so the purpose is unambiguous. It stops short of explicitly differentiating itself from the pipeline siblings, which would have earned a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied: an agent can infer this is the tool to call when it needs a template task to start from. There is no explicit statement of when to use it versus alternatives, nor any prerequisite or exclusion.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mathematica_exportC
从真实 Wolfram 图形导出 PNG/PDF/CSV。
| Name | Required | Description | Default |
|---|---|---|---|
| out_dir | Yes | ||
| timeout | No | ||
| code_path | Yes | ||
| task_path | Yes | ||
| result_path | No | export.json |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden but only discloses output formats. It does not state whether the export writes files, overwrites existing outputs, executes code from code_path, requires a valid task_path, or how errors/timeouts are handled. This is a significant gap for a tool that appears to write to out_dir.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single front-loaded sentence with no wasted words. However, it is too terse for a 5-parameter tool and omits essential structure that would make the definition actionable.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 5 parameters, 0% schema coverage, no annotations, and no output schema, the description is far from complete. It names formats but says nothing about required inputs, output destination behavior, execution model, or return value.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 5 parameters with 0% description coverage, and the description does not explain any of them. task_path, code_path, out_dir, timeout, and result_path are all undocumented, so an agent cannot infer their meanings from the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: exporting PNG/PDF/CSV from real Wolfram graphics. This clearly distinguishes the tool's output-oriented role from evaluation or notebook-editing siblings. However, it does not mention the task/code inputs that drive the export, leaving the purpose somewhat narrow.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives such as mathematica_compute or mathematica_run. It implies usage only through the word 'export', with no explicit context, prerequisites, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mathematica_lintC
静态检查 Wolfram Language 语法与高风险调用。
| Name | Required | Description | Default |
|---|---|---|---|
| task_path | Yes | ||
| allow_external | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the full burden, and it does disclose that the check is static (non-executing) and targets risky calls. Beyond that it says nothing about what is reported, whether findings block a pipeline, or what allow_external changes — a notable gap for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with no filler, which is structurally sound. It is arguably too terse for the information gaps it leaves, but nothing in it is wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no annotations, no output schema, and two undocumented parameters, the description is not complete enough: an agent cannot tell what task_path should point at, what allow_external enables, or what a lint result looks like. Given the tool's low complexity, one or two more sentences would have closed the gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate and does not: neither task_path (a path to what — a file, a task directory?) nor allow_external is explained. allow_external is especially opaque, since its effect on lint behavior (external file or symbol resolution) is entirely unstated.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a specific verb (static check) and a specific resource (Wolfram Language syntax plus high-risk calls), so an agent knows this analyzes code without executing it. It does not, however, distinguish itself from the overlapping siblings mathematica_verify and mathematica_doctor, which likely cover adjacent ground.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to reach for this tool rather than mathematica_verify, mathematica_doctor, or mathematica_run. The word '静态' hints that it belongs before execution, but the agent must infer that, and no exclusions or preconditions are stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mathematica_planB
解析任务 JSON 并返回执行计划,不启动 Mathematica。
| Name | Required | Description | Default |
|---|---|---|---|
| task_path | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden; it does disclose the key non-effect trait (no Mathematica process is launched), which is valuable. However, it says nothing about what the returned plan looks like, whether the task file is validated or modified, or how missing/invalid paths are handled.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One short sentence that front-loads the core action and appends the key non-behavioral constraint; there is no filler. It is compact to the point of omitting information an agent needs, but nothing written is wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a parameter that is fully undocumented and with no output schema and no annotations, the description is too thin. An agent must guess what to pass and cannot anticipate what the returned plan contains or how failures surface.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There is a single required parameter, task_path, with 0% schema description coverage, so the description must compensate — and it does not. It never explains whether task_path is a file path, a directory, or a JSON string, nor what format the file must have.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and object: it parses a task JSON and returns an execution plan. It also explicitly rules out the execution behavior of siblings like mathematica_run and mathematica_compute ('does not start Mathematica'), which helps differentiate. What a 'task JSON' contains is left undefined, which slightly weakens the clarity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'does not start Mathematica' implies that this is a dry-run/planning step before running or evaluating, but the description never states when to prefer it over mathematica_build, mathematica_verify, or mathematica_run. Usage is only inferable, not explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mathematica_runC
跑完整流水线:预检、原生执行、导出、重开复算、对账、交付。
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | ||
| dry_run | No | ||
| out_dir | No | ||
| timeout | No | ||
| no_rerun | No | ||
| overwrite | No | ||
| task_path | Yes | ||
| allow_draft | No | ||
| no_frontend | No | ||
| allow_external | No | ||
| frontend_timeout | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must carry the full behavioral burden, and it does disclose the execution sequence (precheck → execute → export → re-run → reconcile → deliver), which tells the agent this is a long, composite, stateful operation. It says nothing about side effects (files written to out_dir, overwrite semantics), expected duration (timeout defaults to 900s, frontend to 240s), or failure/partial-success behavior, which are the traits that matter most for a pipeline of this weight.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with a colon-separated stage list — dense and waste-free. Its brevity is appropriate structurally, though it is concise to the point of under-specification for an 11-parameter tool (that cost is charged under contextual completeness).
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a heavy 11-parameter pipeline with no annotations and no output schema, the definition omits nearly everything an agent needs: what task_path points to, what the run produces, whether it is safe/idempotent, and how long it takes. The stage enumeration gives a rough mental model but is far short of sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Eleven parameters with 0% schema description coverage, and the description explains none of them. Flags like dry_run, no_rerun, allow_draft, allow_external, no_frontend and overwrite are semantically loaded and cannot be guessed from their names alone, especially the safety-relevant ones. This is a severe compensation failure at the lowest coverage tier.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a concrete action (run the full pipeline) and enumerates the six stages: precheck, native execution, export, reopen-and-recompute, reconciliation, delivery. This implicitly distinguishes it from the single-step siblings (mathematica_doctor, mathematica_export, mathematica_verify), though it never names them. Clear purpose, but sibling differentiation is left to inference.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The word '完整' (full/complete) hints that this is the end-to-end option versus the individual stage tools, which is an implied routing signal. However, there is no explicit statement of when to choose this over mathematica_build + mathematica_export + mathematica_verify, and no prerequisites or exclusions are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mathematica_verifyC
在干净内核中重新执行 checks 并与参考结果比较。
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | ||
| out_path | Yes | ||
| code_path | Yes | ||
| task_path | Yes | ||
| previous_path | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It does disclose one useful trait — execution happens in a clean kernel, implying no state leakage — but says nothing about what gets written to out_path, how failures are reported, timeout behavior, or what happens with previous_path.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One short sentence with no wasted words, and the key idea (clean-kernel re-execution plus comparison) is front-loaded. But the brevity reads as under-specification rather than efficiency for a five-parameter tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a verification tool with three required paths, an optional previous result, a timeout, no annotations, and no output schema, a single sentence is far too thin. The agent knows the gist but lacks enough to call it correctly the first time.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% across five parameters, so the description must compensate and does not. It never distinguishes task_path from code_path, never explains what previous_path is for, and never mentions the timeout default.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb+resource: re-execute checks in a clean kernel and compare against reference results. That is a recognizable verification operation distinct from running or computing. It does not, however, explicitly contrast itself with siblings like mathematica_run or mathematica_compute, so an agent must infer the difference from 'clean kernel'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no statement of when to use this tool versus mathematica_run, mathematica_compute, or mathematica_lint. The phrase 'in a clean kernel' hints at isolated verification but never spells out the condition that should select this tool over re-running code.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
11 tool updates
v0.1.0- First observed
mathematica_build - First observed
mathematica_compute - First observed
mathematica_doctor - First observed
mathematica_edit_notebook - First observed
mathematica_evaluate_notebook - First observed
mathematica_example - First observed
mathematica_export - First observed
mathematica_lint - First observed
mathematica_plan - First observed
mathematica_run - First observed
mathematica_verify
TDQS
Scored across 11 tools
Each tool has a distinct role in the Mathematica workflow, and descriptions explicitly distinguish quick execution (mathematica_compute) from full verified pipelines (mathematica_run). However, mathematica_run orchestrates execution, export, and verification, creating intentional overlap with mathematica_compute, mathematica_export, and mathematica_verify that could still cause hesitation between single-step and full-pipeline tools.
All tools follow the same mathematica_ prefix with lowercase verb or noun names, such as mathematica_run, mathematica_export, and mathematica_edit_notebook. The convention is predictable and consistent throughout.
Eleven tools is well within the ideal range and fits the multi-stage nature of Mathematica diagnostics, planning, building, execution, notebook editing, export, and verification. Each tool appears to earn its place rather than bloating the surface.
The surface covers a full workflow from environment diagnostics and planning through linting, building, running, notebook evaluation/editing, exporting, and verification, plus a sample-task helper. Minor gaps remain around notebook or task inventory/cleanup operations, but core lifecycle needs are well covered.
Maintenance
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Integrates Wolfram Language and Wolfram|Alpha accessing curated data and sophisticated algorithms.
Build and run AI workflows, agents, data tables and 1000+ API integrations from any MCP client.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- FlicenseAqualityDmaintenanceAllows LLMs to execute Wolfram Language code in a secure, session-based environment by providing an interface to interact with a Wolfram Mathematica kernel.34-
- AlicenseAqualityFmaintenanceAn MCP server that connects AI assistants to a local Wolfram Engine, enabling symbolic math, numerical analysis, and data visualization through Wolfram Language. It provides secure expression filtering, client authentication, and supports both local stdio and HTTP transports.232MIT
- AlicenseCqualityCmaintenanceEnables AI agents to run Mathematica code, control live notebooks, and verify results through natural language.8270 PyPI54MIT
- AlicenseAqualityDmaintenanceEnables evaluating Wolfram Language code and retrieving Wolfram Engine version/license info through an MCP interface.431 PyPI8MIT