Skip to main content
Glama

mathematica_edit_notebook

Make targeted edits to existing Wolfram notebooks—replace, insert, or append cells, change titles, or switch title language—then save to a new file by default and verify encoding on readback.

Instructions

在既有 .nb 上做定点修改(替换/插入/追加单元、改标题、翻转标题语言),默认另存新文件,写入后回读校验编码,不会产生乱码。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "notebook_path": "<notebook_path>"
    },
    "name": "mathematica_edit_notebook"
  }
}

Input Schema

NameRequiredDescriptionDefault
editsNo也可以直接内联修改指令
timeoutNo
in_placeNo覆盖源文件,会先备份 .nb.<stamp>.bak
out_pathNo输出路径;省略则写同目录 -edited.nb
edits_pathNo修改指令 JSON 路径
notebook_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.