reset_sage_session

MCP tool from Sagemath MCP by XBP-Europe

Clear all variables, functions, and definitions in the current session. The underlying worker process continues running (fast). Equivalent to restarting a fresh Sage shell.

How to use it

reset_sage_session is exposed by the Sagemath MCP MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the reset_sage_session tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.

Install Sagemath MCP

$docker run -p 8314:8314 sagemath-mcp:latest --transport streamable-http
FULL SAGEMATH MCP LISTING

Other tools in Sagemath MCP (22)

calculate_expression

Evaluate a symbolic expression and return both its string representation and numeric value (when possible). Uses Sage's sageeval() internally with pre-declared variables x, y, z, t.

cancel_sage_session

Abort any in-flight computation by killing the worker process and starting a new one. All session state is lost — reach for this only when the worker is wedged badly enough that interrupting does not help.

check_sage_health

The MCP-level readiness probe, for stdio clients that cannot reach the HTTP

differentiate_expression

Compute the symbolic derivative of an expression. Calls Sage's diff(expr, var, order) internally.

evaluate_sage

-- Open-Ended SageMath Execution

expand_expression

Expand products, powers, and trigonometric/logarithmic identities using Sage's expand().

factor_expression

Factor a symbolic expression or integer using Sage's factor().

integrate_expression

Compute indefinite or definite integrals. Calls Sage's integrate() function.

interrupt_sage_session

Stop a running computation while keeping every variable defined so far. The worker is signalled, abandons the current statement, and stays alive with its namespace intact. The interrupted call returns an Interrupted error.

limit_expression

Compute the limit of an expression as a variable approaches a point. Calls Sage's limit() function.

lookup_sage_doc

Documentation links for one SageMath name, plus the half the upstream manual

matrix_multiply

Multiply two matrices over the Symbolic Ring (SR). Input matrices are nested lists of numbers.

matrix_operation

Perform a single matrix operation. Supports six operations on matrices over the Symbolic Ring.

number_theory_operation

Perform common number-theoretic operations using Sage's built-in functions.

plot_expression

Render a 2D plot of an expression and return it as MCP image content (PNG by default, or SVG via imageformat) the client displays inline. Calls Sage's plot(), renders to an in-memory buffer at a bounded size, and returns it as an image block rather than a base64 string.

series_expansion

Compute a Taylor or Laurent series expansion around a point. Calls Sage's .series() method.

simplify_expression

Apply Sage's simplify() function to reduce a symbolic expression to a simpler form.

solve_equation

Solve a single equation or a system of simultaneous equations. Calls Sage's solve() function. Equations are parsed by splitting on =: the string "x^2 - 1 = 0" becomes the Sage equation x^2 - 1 == 0.

solve_ode

Solve an ordinary differential equation using Sage's desolve(). The equation is specified as a string using Sage's diff() notation. The solver returns a general solution with arbitrary constants (C, K1, K2, etc.).

statistics_summary

Compute descriptive statistics for a numeric dataset using Sage's mean() and sqrt() functions.

verify_claim

The checking primitive for the dominant failure mode of models doing

workspace_token

a server-issued, unguessable handle that addresses that one