Symbolic Algebra MCP Server

by sdiehl

substitute_expression

Replace a variable in a mathematical expression with another expression using SymPy's substitution method to simplify or transform equations.

Instructions

Substitutes a variable in an expression with another expression using SymPy's subs method.

Args: expr_key: The key of the expression to perform substitution on. var_name: The name of the variable to substitute. replacement_expr_key: The key of the expression to substitute in place of the variable. Example: # Create variables x and y intro("x", [], []) intro("y", [], []) # Create expressions expr1 = introduce_expression("x**2 + y**2") expr2 = introduce_expression("sin(x)") # Substitute y with sin(x) in x^2 + y^2 result = substitute_expression(expr1, "y", expr2) # Results in x^2 + sin^2(x) Returns: A key for the resulting expression after substitution.

Input Schema

NameRequiredDescriptionDefault
expr_keyYes
replacement_expr_keyYes
var_nameYes

Input Schema (JSON Schema)

{ "properties": { "expr_key": { "title": "Expr Key", "type": "string" }, "replacement_expr_key": { "title": "Replacement Expr Key", "type": "string" }, "var_name": { "title": "Var Name", "type": "string" } }, "required": [ "expr_key", "var_name", "replacement_expr_key" ], "title": "substitute_expressionArguments", "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sdiehl/sympy-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server