Elysia Tools Docs
EN
Language
ZHESPTRUFRDEEN
Back to site
Browse tools

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-equilibrium

Parameters

NameTypeRequiredDescription
modeselectYesChoose allele-frequency mode or genotype-counts mode.
qFreqnumberNoFrequency of the recessive allele q (0–1). Used in frequency mode only.
aaCountnumberNoObserved count of genotype aa. Used in counts mode only.
AaCountnumberNoObserved count of genotype Aa. Used in counts mode only.
AACountnumberNo

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]

Browse toolsOpen tool

© 2026 Elysia Tools. Developer documentation.

Back to siteBrowse tools
Observed count of genotype AA. Used in counts mode only.
decimalPlacesnumberNo—

Response format

JSON result

JSON
{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}