math-tools

81
1
Source

Deterministic mathematical computation using SymPy. Use for ANY math operation requiring exact/verified results - basic arithmetic, algebra (simplify, expand, factor, solve equations), calculus (derivatives, integrals, limits, series), linear algebra (matrices, determinants, eigenvalues), trigonometry, number theory (primes, GCD/LCM, factorization), and statistics. Ensures mathematical accuracy by using symbolic computation rather than LLM estimation.

Install

mkdir -p .claude/skills/math-tools && curl -L -o skill.zip "https://mcp.directory/api/skills/download/183" && unzip -o skill.zip -d .claude/skills/math-tools && rm skill.zip

Installs to .claude/skills/math-tools

About this skill

Math Tools

Deterministic mathematical computation engine using SymPy. All calculations use symbolic math - no LLM estimation.

When to Use

Use this skill whenever mathematical accuracy matters:

  • Arithmetic involving fractions, roots, or large numbers
  • Algebraic simplification, expansion, factoring
  • Solving equations (polynomial, transcendental, systems)
  • Calculus (derivatives, integrals, limits, series)
  • Linear algebra (matrices, eigenvalues, determinants)
  • Number theory (primes, factorization, GCD/LCM)
  • Statistical calculations

Quick Start

Run the calculator script with operation and arguments:

python scripts/math_calculator.py <operation> <args...>

All results return JSON with result, latex, and numeric fields.

Core Operations

Arithmetic

python scripts/math_calculator.py add 5 3 2          # 10
python scripts/math_calculator.py multiply 2 3 4    # 24
python scripts/math_calculator.py divide 10 4       # 5/2 (exact)
python scripts/math_calculator.py sqrt 8            # 2*sqrt(2)
python scripts/math_calculator.py factorial 10      # 3628800

Algebra

# Simplify
python scripts/math_calculator.py simplify "(x**2 - 1)/(x - 1)"
# → x + 1

# Expand
python scripts/math_calculator.py expand "(x + 1)**3"
# → x**3 + 3*x**2 + 3*x + 1

# Factor
python scripts/math_calculator.py factor "x**3 - 8"
# → (x - 2)*(x**2 + 2*x + 4)

# Solve equations
python scripts/math_calculator.py solve "x**2 - 5*x + 6" x
# → [2, 3]

python scripts/math_calculator.py solve "2*x + 3 = 7" x
# → [2]

Calculus

# Derivative
python scripts/math_calculator.py derivative "x**3 + sin(x)" x
# → 3*x**2 + cos(x)

# Second derivative
python scripts/math_calculator.py derivative "x**4" x 2
# → 12*x**2

# Indefinite integral
python scripts/math_calculator.py integrate "x**2" x
# → x**3/3

# Definite integral
python scripts/math_calculator.py integrate "x**2" x 0 1
# → 1/3

# Limit
python scripts/math_calculator.py limit "sin(x)/x" x 0
# → 1

# Limit at infinity
python scripts/math_calculator.py limit "(x**2 + 1)/(x**2 - 1)" x oo
# → 1

# Taylor series
python scripts/math_calculator.py series "exp(x)" x 0 5
# → 1 + x + x**2/2 + x**3/6 + x**4/24 + O(x**5)

Linear Algebra

# Determinant
python scripts/math_calculator.py det '[[1,2],[3,4]]'
# → -2

# Inverse
python scripts/math_calculator.py inverse '[[1,2],[3,4]]'

# Eigenvalues
python scripts/math_calculator.py eigenvalues '[[4,2],[1,3]]'
# → {5: 1, 2: 1}

# RREF
python scripts/math_calculator.py rref '[[1,2,3],[4,5,6]]'

Number Theory

python scripts/math_calculator.py gcd 24 36 48       # 12
python scripts/math_calculator.py lcm 4 6 8         # 24
python scripts/math_calculator.py prime_factors 360  # 2^3 × 3^2 × 5
python scripts/math_calculator.py is_prime 17       # true
python scripts/math_calculator.py nth_prime 100     # 541
python scripts/math_calculator.py binomial 10 3     # 120

Statistics

python scripts/math_calculator.py mean '[1,2,3,4,5]'      # 3
python scripts/math_calculator.py variance '[1,2,3,4,5]'  # 2
python scripts/math_calculator.py std_dev '[1,2,3,4,5]'   # sqrt(2)

Utilities

# Numerical evaluation with precision
python scripts/math_calculator.py evaluate "pi" 50

# LaTeX output
python scripts/math_calculator.py latex "x**2 + 1/x"
# → x^{2} + \frac{1}{x}

# Compare expressions
python scripts/math_calculator.py compare "(x+1)**2" "x**2 + 2*x + 1"
# → equal: true

Expression Syntax

  • Powers: x**2 or x^2
  • Multiplication: 2*x or 2x (implicit)
  • Functions: sin(x), cos(x), exp(x), log(x), sqrt(x)
  • Constants: pi, E, I (imaginary), oo (infinity)

Complex Operations (JSON Input)

For operations requiring structured input:

# Solve system of equations
python scripts/math_calculator.py solve_system \
  '{"equations": ["x + y = 10", "x - y = 2"], "variables": ["x", "y"]}'

# Substitute values
python scripts/math_calculator.py substitute \
  '{"expr_str": "x**2 + y", "substitutions": {"x": 3, "y": 2}}'

# Matrix multiplication
python scripts/math_calculator.py matrix_mult \
  '{"matrix_a": [[1,2],[3,4]], "matrix_b": [[5,6],[7,8]]}'

Full API Reference

See references/api_reference.md for complete documentation of all operations, including:

  • All operation names and aliases
  • Detailed parameter descriptions
  • Output format specifications
  • Additional examples

Dependencies

Requires SymPy:

pip install sympy

More by ananddtyagi

View all →

master-plan-manager

ananddtyagi

Safe MASTER_PLAN.md management with backup, validation, and intelligent updates. Use when updating task tracking, adding features to roadmap, or modifying project documentation.

00

api-contract-sync-manager

ananddtyagi

Validate OpenAPI, Swagger, and GraphQL schemas match backend implementation. Detect breaking changes, generate TypeScript clients, and ensure API documentation stays synchronized. Use when working with API spec files (.yaml, .json, .graphql), reviewing API changes, generating frontend types, or validating endpoint implementations.

20

data-safety-auditor

ananddtyagi

Comprehensive data safety auditor for Vue 3 + Pinia + IndexedDB + PouchDB applications. Detects data loss risks, sync issues, race conditions, and browser-specific vulnerabilities with actionable remediation guidance.

20

skill-creator-doctor

ananddtyagi

Create, repair, maintain, and consolidate skills. This skill should be used when users want to create new skills, fix broken skills that won't load, diagnose skill system issues, maintain skill health, or consolidate duplicate/obsolete skills. Automatically detects and repairs common skill loading problems including missing registry entries, metadata format issues, and structural problems. Provides comprehensive skill ecosystem management including duplicate detection, merge workflows, and archival processes.

30

document-sync

ananddtyagi

A robust skill that analyzes your app's actual codebase, tech stack, configuration, and architecture to ensure ALL documentation is current and accurate. It never assumes—always verifies and compares the live system with every documentation file to detect code-doc drift and generate actionable updates.

40

plugin-creator

ananddtyagi

Create, validate, and publish Claude Code plugins and marketplaces. Use this skill when building plugins with commands, agents, hooks, MCP servers, or skills.

200

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

284790

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

212415

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

202286

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

214231

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

169197

rust-coding-skill

UtakataKyosui

Guides Claude in writing idiomatic, efficient, well-structured Rust code using proper data modeling, traits, impl organization, macros, and build-speed best practices.

165173

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.