Education
Hardy-Weinberg Equilibrium Calculator (p² + 2pq + q² = 1)
Compute allele and expected genotype frequencies under Hardy-Weinberg equilibrium. Two modes: allele frequency or genotype counts with chi-square test. Derived from Hardy 1908, Weinberg 1908, Wigginton 2005, StatPearls. Educational use only.
json· JSON resultOpen tool
Quick start
Call this tool from your code in three languages.
cURL
curl -X POST 'https://api.elysiatools.com/en/api/tools/hardy-weinberg-equilibrium' \
-H 'Content-Type: application/json' \
-d '{"mode":"frequency","qFreq":0.01,"aaCount":0,"AaCount":0,"AACount":0,"decimalPlaces":4}'API reference
Send a POST request with your inputs as JSON. File parameters require a separate upload first.
Endpoint
HTTP
POST https://api.elysiatools.com/en/api/tools/hardy-weinberg-equilibriumParameters
| Name | Type | Required | Description |
|---|---|---|---|
| mode | select | Yes | Choose allele-frequency mode or genotype-counts mode. |
| qFreq | number | No | Frequency of the recessive allele q (0–1). Used in frequency mode only. |
| aaCount | number | No | Observed count of genotype aa. Used in counts mode only. |
| AaCount | number | No | Observed count of genotype Aa. Used in counts mode only. |
| AACount | number | No |
MCP integration
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Server configuration
Add this block to your MCP client configuration:
mcp.json
{
"mcpServers": {
"elysiatools-hardy-weinberg-equilibrium": {
"name": "hardy-weinberg-equilibrium",
"description": "Compute allele and expected genotype frequencies under Hardy-Weinberg equilibrium. Two modes: allele frequency or genotype counts with chi-square test. Derived from Hardy 1908, Weinberg 1908, Wigginton 2005, StatPearls. Educational use only.",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=hardy-weinberg-equilibrium",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}List available tools
After connecting to the SSE endpoint, list the exposed tools:
tools/list
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Call this tool
Invoke the tool by its id, passing arguments built from its parameters:
tools/call
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "hardy-weinberg-equilibrium",
"arguments": {
"mode": "frequency",
"qFreq": 0.01,
"aaCount": 0,
"AaCount": 0,
"AACount": 0,
"decimalPlaces": 4
}
}
}Chain multiple tools in one session with a comma-separated toolId list, e.g. /mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp (max 20).
Questions or issues? Contact [email protected]