Skip to main content
Glama

Inspect or restart the Mathematica kernel

mathematica_kernel_status

Check local Mathematica kernel status (pid, uptime, call count), restart to clear in-memory state, or interrupt it via restart.

Instructions

Report whether the local Mathematica kernel is running (pid, uptime, call count), restart it, or interrupt it. Restarting clears all in-memory state. Interrupt is implemented as a restart because a batch math.exe cannot be reliably interrupted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoAction to perform (default "status").status

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden and does well: it discloses that restart is destructive to in-memory state and that interrupt is silently implemented as a restart due to batch math.exe limitations. That last detail is exactly the kind of non-obvious behavior an agent must know before invoking. It does not say whether the operation requires the kernel to be up, or what happens to concurrent evaluations during a restart.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two compact sentences, both load-bearing: the first states scope and return fields, the second carries the two destructive-behavior caveats. Nothing is redundant and the most consequential warning is not buried.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description appropriately names the status payload fields (pid, uptime, call count). It is nearly complete for a 1-parameter tool; the only gap is what restart/interrupt return and how failures surface, which an agent would still need to discover.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a single enum parameter and a documented default, so the schema already establishes the baseline. The description still adds meaning by explaining the consequence of the 'restart' and 'interrupt' values, which the terse schema description does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names the specific resource (local Mathematica kernel) and enumerates the three operations it supports: report status with pid/uptime/call count, restart, and interrupt. That verb-plus-resource specificity makes it clearly distinguishable from siblings like mathematica_evaluate and mathematica_export, which operate on expressions rather than process lifecycle.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description makes clear what each action does and warns that restart wipes in-memory state, which helps an agent choose between status and restart. It stops short of stating an explicit when-to-use rule (e.g. 'use status to health-check before evaluating, restart after a hung call'), and does not point to any sibling tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.