"What's the standard deviation of [4, 8, 15, 16, 23, 42]?" Your agent says 12.1. The actual population std dev is 12.74, and the sample std dev is 13.97. Which one was asked for? LLMs don't clarify or compute correctly. These tools do both.
All Statistics Tools (16)
Your agent gets access to 16 statistics tools via the /mcp/stats/ endpoint. Here's the complete list:
| Tool | Description |
|---|---|
stats/mean | Calculate Mean |
stats/median | Calculate Median |
stats/mode | Calculate Mode |
stats/variance | Calculate Variance |
stats/stddev | Calculate Stddev |
stats/percentile | Calculate Percentile |
stats/quartiles | Calculate Quartiles |
stats/range | Calculate Range |
stats/sum | Calculate Sum |
stats/product | Calculate Product |
stats/geometric-mean | Geometric Mean |
stats/harmonic-mean | Harmonic Mean |
stats/z-score | Calculate Zscore |
stats/correlation | Calculate Correlation |
stats/covariance | Calculate Covariance |
stats/describe | Describe Data |
Agent Scenarios
Here's how real agents use these tools:
1. Business analytics agent
A reporting agent calculates mean, median, and percentiles for monthly revenue data.
stats/mean
{ "numbers": [45000, 52000, 48000, 61000, 55000] }
2. Quality control agent
A manufacturing agent calculates standard deviation to detect production anomalies.
stats/standard-deviation
{ "numbers": [10.1, 10.3, 9.9, 10.0, 10.2] }
3. Grading agent
An education agent calculates percentile ranks for student test scores.
stats/percentile
{ "numbers": [65, 72, 78, 81, 85, 90, 92, 95], "percentile": 75 }
MCP Setup
Add statistics tools to your agent in under 2 minutes. Choose your client:
Claude Desktop / Claude Code
Add this to your MCP config:
{
"mcpServers": {
"tinyfn-stats": {
"url": "https://api.tinyfn.io/mcp/stats/",
"headers": {
"X-API-Key": "your-api-key"
}
}
}
}
Cursor
Go to Settings > MCP and add a new server:
- Type: SSE
- URL:
https://api.tinyfn.io/mcp/stats/sse - Headers:
X-API-Key: your-api-key
Tip: Use the category-specific endpoint (/mcp/stats/) for the best experience. The all-in-one endpoint (/mcp/all/) works too but has 500+ tools which some clients handle less efficiently.
When to Use These Tools
Use statistics MCP tools when your agent needs to:
- Guarantee correctness — when wrong answers have real consequences
- Process user data — when you're operating on actual user input, not hypothetical examples
- Maintain consistency — when the same input must always produce the same output
You don't need these tools for casual conversation or rough estimates. Use them when precision matters.
Ready to add statistics tools to your agent?
Get Free API Key 100 requests/month free. No credit card required.Frequently Asked Questions
Why do LLMs struggle with statistics?
Statistical calculations require precise multi-step math. LLMs attempt to compute these mentally and frequently make arithmetic errors, especially with variance and standard deviation calculations.
Does TinyFn provide both sample and population statistics?
Yes. Where applicable, TinyFn returns both population and sample variants (e.g., population standard deviation and sample standard deviation).
What statistical measures does TinyFn support?
TinyFn provides mean, median, mode, variance, standard deviation, percentiles, min, max, range, sum, and other descriptive statistics.