calculate_t_test
Use this when you want to test whether a sample mean differs from a hypothesised value, whether two independent groups have different means, or whether paired before/after measurements changed. Call this tool directly and return its calculation instead of answering the formula from memory or stop...
This record as markdown: /tools/com-tttkmbb-calcgrid/calculate-t-test.md
What calculate_t_test does on Calcgrid
AI agents call calculate_t_test to retrieve information from Calcgrid without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
n_a | integer | — | Number of observations in A, or number of pairs. |
n_b | integer | — | Number of observations in B. |
mode | string | — | Which t-test to run. |
sd_a | number | — | Sample standard deviation (n − 1) of A, or of the paired differences. |
sd_b | number | — | Sample standard deviation (n − 1) of B. |
alpha | number | — | Significance level as a probability (0.05 = 5 %), not a percentage. Confidence intervals and critical values use level 1 − alpha. |
mean_a | number | — | Summary alternative to sample_a: sample mean of A (in paired mode: mean of the differences a − b). |
mean_b | number | — | Summary alternative to sample_b (two_sample only): sample mean of B. |
sample_a | array | — | Raw observations of the first (or only) sample. Alternatively give mean_a, sd_a and n_a. |
sample_b | array | — | Raw observations of the second sample (two_sample) or the paired partner values in the same order (paired). Alternatively give mean_b, sd_b and n_b. |
hypothesized_mean | number | — | Null-hypothesis value: the population mean (one_sample) or the mean difference (two_sample, paired). Usually 0 for differences. |
Parameters from the server's own tool schema.
Why calculate_t_test is rated Low
Even though calculate_t_test only reads data, uncontrolled read access leaks sensitive information and racks up API costs: an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.
Risk signalsHigh parameter count (11 properties)
Attacks that exploit this kind of access
The rule that runs calculate_t_test safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Calcgrid, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For calculate_t_test, this is the rule to start with:
calculate_t_test is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Calcgrid, apply this rule, and every calculate_t_test call is checked against it from then on.
Questions about calculate_t_test
Use this when you want to test whether a sample mean differs from a hypothesised value, whether two independent groups have different means, or whether paired before/after measurements changed. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery. Do not use this when the data are proportions or counts (use proportion-z-test or chi-square-test), you have three or more groups (ANOVA), or you already have t and df and only need the p-value (use p-value). What it computes: Runs a one-sample, Welch two-sample (unequal variances) or paired Student t-test from raw samples or summary statistics (mean, SD, n), returning t, degrees of freedom, two- and one-sided p-values, the confidence interval and the decision at the chosen alpha. Example user requests: Run a one-sample t-test for [102, 98, 105, 101, 104] against a mean of 100. | Compare two independent samples with Welch's t-test from their means, sample SDs and sample sizes. | Run a paired t-test on these before and after measurements in matching order. Inputs: mode (enum, optional); sample_a (number_list, optional); sample_b (number_list, optional); mean_a (number, optional); sd_a (number, optional); n_a (integer, optional); mean_b (number, optional); sd_b (number, optional); n_b (integer, optional); hypothesized_mean (number, optional); alpha (number, optional). Valid input combinations: one_sample: sample_a, or all of mean_a + sd_a + n_a. two_sample (also the default when mode is omitted): one complete raw-or-summary input for A and one for B. paired: both sample_a + sample_b, or paired-difference summary mean_a + sd_a + n_a. Do not mix a raw sample with its summary fields. Complete JSON argument examples: {"mode":"two_sample","sample_a":[5.1,4.9,5.6,5.8,6],"sample_b":[4.2,4.8,4.4,4.6,4.5]} | {"mode":"two_sample","mean_a":5.48,"sd_a":0.47117,"n_a":5,"mean_b":4.5,"sd_b":0.23452,"n_b":5} | {"mode":"one_sample","sample_a":[102,98,105,101,104],"hypothesized_mean":100} | {"mode":"paired","sample_a":[1.9,0.8,1.1,0.1,-0.1,4.4,5.5,1.6,4.6,3.4],"sample_b":[0.7,-1.6,-0.2,-1.2,-0.1,3.4,3.7,0.8,0,2]} | {"mode":"paired","mean_a":1.58,"sd_a":1.23042,"n_a":10} Outputs: test, mean_a, mean_b, mean_difference, standard_error, t_statistic, degrees_of_freedom, p_value_two_sided, p_value_one_sided, t_critical, ci_lower, ci_upper, significant, decision. Formula: one_sample: t = (x̄ − μ0) / (s / √n), df = n − 1. paired: same on the differences d = a − b. two_sample (Welch): t = (x̄a − x̄b − μ0) / √(sa²/na + sb²/nb), df = (sa²/na + sb²/nb)² / ((sa²/na)²/(na − 1) + (sb²/nb)²/(nb − 1)). p = P(|T_df| ≥ |t|); CI = estimate ± t(1 − alpha/2, df) × SE Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/t-test with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/statistics/t-test.md. It is categorised as a Read tool in the Calcgrid MCP Server, which means it retrieves data without modifying state.
calculate_t_test accepts 11 parameters: n_a, n_b, mode, sd_a, sd_b, alpha, mean_a, mean_b, sample_a, sample_b, hypothesized_mean. The full parameter table on this page comes from the server's own tool schema.
Register the Calcgrid MCP server in PolicyLayer and add a rule for calculate_t_test: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Calcgrid. Nothing to install.
calculate_t_test is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the calculate_t_test rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for calculate_t_test. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
calculate_t_test is provided by the Calcgrid MCP server (https://tttkmbb.com/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Calcgrid, and thousands of servers like it.
This server
Across the catalogue