Tools for LLM agents
pppower_mcp_tools.RdReturns the main pppower design calculations as tool definitions
created with ellmer::tool(), so that an LLM agent (for example through
ellmer::chat_anthropic() or an MCP client) can plan prediction-powered
studies. Each tool takes inputs in planning terms (effect size, number of
unlabeled units, \(R^2\), or sensitivity and specificity) and returns the
required labeled sample size or the power, together with the classical
comparison and the main assumptions.
Details
The tools are:
ppi_mean_designOne-sample mean or prevalence.
ppi_two_sample_designDifference of two means.
ppi_two_proportion_designDifference of two proportions.
ppi_paired_designPaired mean difference.
ppi_2x2_designOdds ratio or relative risk in a 2x2 table.
ppi_planning_inputsConverts reported metrics (MSE, sensitivity and specificity, a pilot correlation) into conservative planning inputs.
Regression contrasts need pilot covariance blocks and are not exposed as a
tool; use power_ppi_regression() directly.
Each tool returns a JSON object (as a character string) with named fields.