Skip to main content
Glama
nikhilxnarula

sagemath-mcp

Run Sage

run_sage

Execute arbitrary SageMath code and retrieve its standard output, error, and exit status.

Instructions

Run arbitrary SageMath code and return its stdout, stderr and exit status.

An escape hatch for questions the typed tools do not cover. Print what you want to see; nothing is returned implicitly. Runs in a fresh Sage process, so it cannot see or disturb state from the other tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesSageMath source to execute.
timeoutNoseconds to allow before giving up.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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. It prominently discloses that nothing is returned implicitly, that users must print output, and that execution happens in a fresh Sage process isolated from other tools. This gives an agent a strong mental model of the tool's runtime behavior.

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?

Three tightly written sentences, each earning its place: the first states what the tool does, the second explains when to use it and the printing requirement, and the third clarifies the fresh-process behavior. No redundancy or filler.

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

Completeness5/5

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

The tool has an output schema, so return format details are already covered structurally. The description supplies the missing contextual facts: arbitrary code execution, escape-hatch role, fresh process isolation, and explicit-printing semantics. For a two-parameter tool, this is fully sufficient.

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%, so the parameters are already documented. The description adds meaningful semantic guidance beyond the schema by explaining that explicit printing is required and that no implicit result is returned, which clarifies how the 'code' parameter should be used.

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?

States a specific verb and resource: 'Run arbitrary SageMath code' and clearly identifies what is returned (stdout, stderr, exit status). It also distinguishes itself from the specialized sibling tools by framing itself as an 'escape hatch' for questions those tools do not cover.

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 clearly indicates when to use this tool: when the typed sibling tools do not cover the question. It does not explicitly name alternatives or state when not to use it, but the 'escape hatch' phrasing strongly implies it is a fallback rather than a first choice.

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