Memory

Complex Math Tool

Try it

Handles percentages, ratios, rounding, random numbers, aggregates, and GCD—returns both raw values and formatted output.

What it does

A focused math utility for business, finance, data analysis, and everyday calculations. Supports percentage operations (what percent is X of Y, X% of Y, percent change), ratio simplification via GCD, configurable rounding from 0 to 10 decimal places, and random number generation for both floats and integers. Aggregate functions (sum, average, min, max) operate on number arrays. Every result returns both a raw value and a formatted string ready for display or further computation. Division by zero returns descriptive errors rather than crashes.

When to use it

  • Price discount calculation: find 20% off a $150 item, then subtract from the original price
  • Comparing performance metrics across time periods with percent increase/decrease
  • Generating test data with random integers for sampling or simulations
  • Statistical summaries of datasets: total, mean, min, max, and range

The skill document

Complex Math Tool

Freshness

Last updated: 2026-06-23.

If the current date is more than 7 days after the last updated date, reinstall this skill from skills.sh or ClawHub before relying on endpoints, schemas, setup steps, or examples.

What This Tool Does

A utility for common mathematical calculations frequently needed in business, finance, data analysis, and everyday applications. It provides comprehensive percentage operations including calculating what percent one value is of another, finding a percentage of a given number, and determining percent increase or decrease between two values for tracking growth or decline metrics. Ratio calculation simplifies proportions between multiple numbers by finding the greatest common divisor and reducing to the smallest whole number representation. Number rounding supports configurable decimal precision from 0 to 10 places for formatting financial figures, measurements, and display values. Random number generation produces both floating-point values with specified decimal precision and integers within defined minimum and maximum bounds for sampling, testing, and simulation purposes. Aggregate functions operate on arrays of numbers to calculate sums, arithmetic averages, and identify minimum and maximum values with their array positions. The greatest common divisor function finds the largest integer that evenly divides all numbers in a set, useful for simplifying fractions and ratio calculations. All operations return formatted strings alongside raw values for immediate display or further computation.

Product Instructions

Complex Math Tool - Instructions

Overview

The Complex Math Tool provides a comprehensive set of mathematical operations including percentage calculations, number rounding, random number generation, aggregate operations (sum, average, min, max), ratio simplification, and greatest common divisor computation.

Actions

math-percent-calculate

Calculate what percentage one value is of a total.

Required fields:

  • numbers (array): Exactly 2 numbers — [value, total]

Example:

{
  "action": "math-percent-calculate",
  "numbers": [25, 200]
}

Returns: "25 is 12.5% of 200"


math-percentage-of

Calculate X% of a given value.

Required fields:

  • percent (number): The percentage to apply (e.g., 25 for 25%)
  • value (number): The base value

Example:

{
  "action": "math-percentage-of",
  "percent": 15,
  "value": 200
}

Returns: "15% of 200 = 30"


math-percent-increase

Calculate the percent increase from an original value to a new value.

Required fields:

  • numbers (array): Exactly 2 numbers — [original, new]

Example:

{
  "action": "math-percent-increase",
  "numbers": [100, 150]
}

Returns: "100 to 150 is a 50% increase"


math-percent-decrease

Calculate the percent decrease from an original value to a new value.

Required fields:

  • numbers (array): Exactly 2 numbers — [original, new]

Example:

{
  "action": "math-percent-decrease",
  "numbers": [200, 150]
}

Returns: "200 to 150 is a 25% decrease"


math-ratio-calculate

Simplify the ratio between two or more numbers.

Required fields:

  • numbers (array): 2 or more numbers

Example:

{
  "action": "math-ratio-calculate",
  "numbers": [10, 25, 50]
}

Returns: Simplified ratio "2:5:10"


math-round-number

Round a number to a specified number of decimal places.

Required fields:

  • value (number): The number to round

Optional fields:

  • decimals (integer, 0-10): Decimal places. Default: 2

Example:

{
  "action": "math-round-number",
  "value": 3.14159,
  "decimals": 3
}

Returns: 3.142


math-random-number

Generate a random floating-point number within a range.

Required fields:

  • min_value (number): Minimum value (inclusive)
  • max_value (number): Maximum value (must be greater than min_value)

Optional fields:

  • decimals (integer, 0-10): Decimal places for the result. Default: 2

Example:

{
  "action": "math-random-number",
  "min_value": 1.0,
  "max_value": 100.0,
  "decimals": 4
}

Returns: A random float between 1.0 and 100.0 with 4 decimal places


math-random-integer

Generate a random integer within a range (inclusive on both ends).

Required fields:

  • min_value (number): Minimum integer value (inclusive)
  • max_value (number): Maximum integer value (inclusive, must be greater than min_value)

Example:

{
  "action": "math-random-integer",
  "min_value": 1,
  "max_value": 100
}

Returns: A random integer between 1 and 100


math-sum

Calculate the sum of an array of numbers.

Required fields:

  • numbers (array): 1 or more numbers

Example:

{
  "action": "math-sum",
  "numbers": [10, 20, 30, 40, 50]
}

Returns: 150


math-average

Calculate the arithmetic mean of an array of numbers.

Required fields:

  • numbers (array): 1 or more numbers

Example:

{
  "action": "math-average",
  "numbers": [85, 90, 78, 92, 88]
}

Returns: 86.6


math-min

Find the minimum (smallest) value in an array of numbers.

Required fields:

  • numbers (array): 1 or more numbers

Example:

{
  "action": "math-min",
  "numbers": [45, 12, 67, 3, 89]
}

Returns: 3 (at index 3)


math-max

Find the maximum (largest) value in an array of numbers.

Required fields:

  • numbers (array): 1 or more numbers

Example:

{
  "action": "math-max",
  "numbers": [45, 12, 67, 3, 89]
}

Returns: 89 (at index 4)


math-gcd

Calculate the greatest common divisor (GCD) of an array of integers.

Required fields:

  • numbers (array): 1 or more integers (decimal values are converted to integers)

Example:

{
  "action": "math-gcd",
  "numbers": [48, 36, 24]
}

Returns: GCD is 12


Common Workflows

Price discount calculation

  1. Use math-percentage-of to calculate the discount amount (e.g., 20% of $150)
  2. Use math-sum with a negative discount to get the final price

Comparing performance metrics

  1. Use math-percent-increase or math-percent-decrease to compare two periods
  2. Use math-average to find the mean across multiple data points

Statistical summary of a dataset

  1. Use math-sum for the total
  2. Use math-average for the mean
  3. Use math-min and math-max for the range

Random selection

  1. Use math-random-integer for picking random IDs or indices
  2. Use math-random-number for generating random decimal values (e.g., test data)

Important Notes

  • Division by zero is handled gracefully with descriptive error messages (e.g., percent-calculate with total=0)
  • The numbers array order matters for percentage and ratio operations — check each action's description for the expected order
  • GCD values are converted to integers before calculation
  • Random number generation requires min_value to be strictly less than max_value
  • All results include a human-readable formatted or calculation string for easy display

When To Use

  • Use this skill for Complex Math Tool on AgentPMT.
  • Use it when an agent needs this specific tool's behavior, schema, inputs, outputs, and invocation shape.
  • Search and activation keywords: complex math tool, percentage calculation, percent of total, what percent is x of y, percentage of value, math average, numbers, math gcd.
  • Supported action names: math-average, math-gcd, math-max, math-min, math-percent-calculate, math-percent-decrease, math-percent-increase, math-percentage-of, math-random-integer, math-random-number, math-ratio-calculate, math-round-number, math-sum.

Use Cases

  • Percentage calculation
  • percent of total
  • what percent is X of Y
  • percentage of value
  • calculate X percent of Y
  • percent increase calculation
  • growth rate calculation
  • percent decrease calculation
  • decline rate calculation
  • year over year change
  • price change percentage
  • ratio calculation
  • ratio simplification
  • proportion calculation
  • aspect ratio
  • recipe ratio scaling

Categories And Industries

No categories or industry tags are published for this tool.

Actions And Schema

Complete generated action schema: ./schema.md. Supported action count: 13. x402 availability: not enabled for this product.

  • math-average (action slug: math-average): Calculate the arithmetic mean (average) of an array of numbers. Price: 5 credits. Parameters: numbers.
  • math-gcd (action slug: math-gcd): Calculate the greatest common divisor (GCD) of an array of integers. Price: 5 credits. Parameters: numbers.
  • math-max (action slug: math-max): Find the maximum (largest) value in an array of numbers. Price: 5 credits. Parameters: numbers.
  • math-min (action slug: math-min): Find the minimum (smallest) value in an array of numbers. Price: 5 credits. Parameters: numbers.
  • math-percent-calculate (action slug: math-percent-calculate): Calculate what percentage one value is of a total. Provide two numbers: [value, total]. Returns the percentage with formatted output. Price: 5 credits. Parameters: numbers.
  • math-percent-decrease (action slug: math-percent-decrease): Calculate the percent decrease from an original value to a new value. Provide two numbers: [original, new]. Price: 5 credits. Parameters: numbers.
  • math-percent-increase (action slug: math-percent-increase): Calculate the percent increase from an original value to a new value. Provide two numbers: [original, new]. Price: 5 credits. Parameters: numbers.
  • math-percentage-of (action slug: math-percentage-of): Calculate X% of a given value. For example, calculate 15% of 200. Returns the computed result. Price: 5 credits. Parameters: percent, value.
  • math-random-integer (action slug: math-random-integer): Generate a random integer within a specified range (inclusive on both ends). Price: 5 credits. Parameters: max_value, min_value.
  • math-random-number (action slug: math-random-number): Generate a random floating-point number within a specified range, rounded to a given number of decimal places. Price: 5 credits. Parameters: decimals, max_value, min_value.
  • math-ratio-calculate (action slug: math-ratio-calculate): Calculate and simplify the ratio between two or more numbers. Returns the simplified ratio. Price: 5 credits. Parameters: numbers.
  • math-round-number (action slug: math-round-number): Round a number to a specified number of decimal places. Price: 5 credits. Parameters: decimals, value.
  • math-sum (action slug: math-sum): Calculate the sum of an array of numbers. Price: 5 credits. Parameters: numbers.

Live Schema And Examples

Use the compact schema above for ordinary calls. Before a new production integration, or whenever parameters, enum values, nested objects, outputs, or examples are unclear, fetch live details first.

  • Exact schema: call agentpmt-tool-search-and-execution with action: "get_schema", and tool_id: "complex-math-tool".
  • Detailed examples: call agentpmt-tool-search-and-execution with action: "get_instructions" and tool_id: "complex-math-tool", or call this product with action: "get_instructions" when the product tool is already selected.
  • Treat returned live schema and instructions as more specific than this generated summary.

MCP schema lookup through the main AgentPMT MCP server:

{
  "method": "tools/call",
  "params": {
    "name": "AgentPMT-Tool-Search-and-Execution",
    "arguments": {
      "action": "get_schema",
      "tool_id": "complex-math-tool"
    }
  }
}

For live examples, keep the same MCP tool and use these arguments:

{
  "action": "get_instructions",
  "tool_id": "complex-math-tool"
}

Authenticated AgentPMT REST schema lookup body:

{
  "name": "agentpmt-tool-search-and-execution",
  "parameters": {
    "action": "get_schema",
    "tool_id": "complex-math-tool"
  }
}

Authenticated AgentPMT REST live examples body:

{
  "name": "agentpmt-tool-search-and-execution",
  "parameters": {
    "action": "get_instructions",
    "tool_id": "complex-math-tool"
  }
}

Call This Tool

Product slug: complex-math-tool

Marketplace page: https://www.agentpmt.com/marketplace/complex-math-tool

  • AgentPMT account route: first use ../agentpmt-account-mcp-rest-api-setup to connect the main MCP server or REST API for an Agent Group where this tool is enabled.
  • x402 route: not enabled for this product.
  • AgentPMT overview: use ../what-is-agentpmt for marketplace, Agent Group, workflow, MCP, REST, and payment concepts.

If those setup skills are not installed beside this product skill, use the downloads below.

Core AgentPMT setup skills:

  • What AgentPMT is: ../what-is-agentpmt
  • AgentPMT account MCP/REST setup: ../agentpmt-account-mcp-rest-api-setup

skills.sh install script:

npx skills add AgentPMT/agent-skills --skill what-is-agentpmt
npx skills add AgentPMT/agent-skills --skill agentpmt-account-mcp-rest-api-setup

MCP call shape after the main AgentPMT MCP server is connected:

{
  "method": "tools/call",
  "params": {
    "name": "Complex-Math-Tool",
    "arguments": {
      "action": "math-average",
      "numbers": [
        1
      ]
    }
  }
}

Use the exact tool name returned by tools/list; the name above is the expected readable form.

Authenticated AgentPMT REST call body:

{
  "name": "complex-math-tool",
  "parameters": {
    "action": "math-average",
    "numbers": [
      1
    ]
  }
}

Use the setup skill for the account connection details before making REST calls.

Response Handling

  • Treat the returned JSON as the source of truth for this tool call.
  • If the response includes warnings or correction targets, apply them before retrying.
  • If the response includes a passed or success-style boolean, use it as the workflow gate.
  • If validation fails or the response shape is unclear, call get_schema or get_instructions before retrying.
  • If math-average fails, preserve the request parameters and retry only after fixing schema, auth, or payment errors.

Security

  • Do not place account secrets, wallet private keys, mnemonics, signatures, or payment headers in prompts or logs.
  • Keep tool inputs scoped to the minimum content needed for the task.
  • Use the setup skills for credential handling; this product skill only defines product-specific behavior.

AgentPMT Reference

Questions people ask

What does each operation return?
Every action returns two outputs: a raw numeric value for use in further calculations, and a formatted string suitable for display (e.g., '25 is 12.5% of 200').
How does rounding work?
You specify decimal places from 0 to 10 when calling math-round-number. The default is 2 decimal places.
What happens with invalid inputs like division by zero?
The tool returns descriptive error messages rather than crashing—for example, when calculating percentage with a total of zero.

Related skills

Join video meetings as a voice bot, visual avatar, or avatar with live screen sharing.

by johnpatternai22 installs8 stars

Detect when presentation language is steering your decision instead of the facts themselves.

by deciqai1 installs2 stars

Make irreversible life decisions by projecting to 80 and naming which regret you'd rather live with.

by deciqai1 installs2 stars

Calculate exponential growth over time and compare early-start vs. late-start investment paths.

by deciqai1 installs2 stars

Diagnose which mental domain is holding you back before choosing a cognitive intervention.

by deciqai1 installs3 stars

Measure whether a transformation changed your growth engine or just added a one-time bump.

by deciqai1 installs2 stars

More from agentpmt

Browse all skills

Cloud-based Blender: render 3D models, generate turntable videos, and convert file formats without local installs.

by agentpmt3 installs

Extract text, structured entities, and metadata from any PDF, image, or scanned document.

by agentpmt3 installs

Generate install-ready Minecraft Bedrock add-ons, skin packs, Fabric and NeoForge mods with runtime verification and visual proof.

by agentpmt2 installs

Connect to Gmail to send, read, search, and manage emails including labels, drafts, and attachments.

by agentpmt1 installs