Astronomy
Convert between light-years (ly), parsecs (pc), astronomical units (AU), kilometers and meters using IAU-defined constants, with a parallax-angle → distance helper.
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/api/tools/light-year-and-astronomical-unit-converter' \
-H 'Content-Type: application/json' \
-d '{"value":1,"fromUnit":"ly","decimals":6,"scientific":false,"parallax":"e.g. 0.7685 (Proxima Centauri)"}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/light-year-and-astronomical-unit-converter| Name | Type | Required | Description |
|---|---|---|---|
| value | number | Yes | The distance value to convert. |
| fromUnit | select | No | The unit of the value you entered. |
| decimals | number | No | Number of digits after the decimal point in the result. |
| scientific | checkbox | No | Display results in scientific (exponential) notation. |
| parallax | text | No |
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-light-year-and-astronomical-unit-converter": {
"name": "light-year-and-astronomical-unit-converter",
"description": "Convert between light-years (ly), parsecs (pc), astronomical units (AU), kilometers and meters using IAU-defined constants, with a parallax-angle → distance helper.",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=light-year-and-astronomical-unit-converter",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "light-year-and-astronomical-unit-converter",
"arguments": {
"value": 1,
"fromUnit": "ly",
"decimals": 6,
"scientific": false,
"parallax": "e.g. 0.7685 (Proxima Centauri)"
}
}
}Questions or issues? Contact [email protected]
| Optional: a stellar parallax angle in arcseconds. Returns distance in pc/ly/AU/km via d(pc) = 1/π(″). |
HTML result
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}