|
@@ -480,14 +480,16 @@ async def calculate_synastry_chart(
|
|
|
|
|
|
|
|
@mcp.tool()
|
|
@mcp.tool()
|
|
|
async def get_transit_preview(
|
|
async def get_transit_preview(
|
|
|
- person_id: str,
|
|
|
|
|
|
|
+ birth_datetime: str,
|
|
|
|
|
+ latitude: float,
|
|
|
|
|
+ longitude: float,
|
|
|
start_date: str,
|
|
start_date: str,
|
|
|
end_date: str,
|
|
end_date: str,
|
|
|
transit_latitude: float | None = None,
|
|
transit_latitude: float | None = None,
|
|
|
transit_longitude: float | None = None,
|
|
transit_longitude: float | None = None,
|
|
|
min_significance: float = 0.0,
|
|
min_significance: float = 0.0,
|
|
|
) -> dict[str, Any]:
|
|
) -> dict[str, Any]:
|
|
|
- """Daily transit-to-natal aspect snapshot for a person over a time range.
|
|
|
|
|
|
|
+ """Daily transit-to-natal aspect snapshot over a time range.
|
|
|
|
|
|
|
|
For each day, shows which transiting planets are aspecting which natal planets,
|
|
For each day, shows which transiting planets are aspecting which natal planets,
|
|
|
with orb, applying/separating status, and significance score (0-10).
|
|
with orb, applying/separating status, and significance score (0-10).
|
|
@@ -499,7 +501,9 @@ async def get_transit_preview(
|
|
|
- Orb tightness (tighter = more significant)
|
|
- Orb tightness (tighter = more significant)
|
|
|
|
|
|
|
|
Args:
|
|
Args:
|
|
|
- person_id: ID of a person in the persons database.
|
|
|
|
|
|
|
+ birth_datetime: ISO 8601 birth datetime (UTC).
|
|
|
|
|
+ latitude: Birth latitude in decimal degrees.
|
|
|
|
|
+ longitude: Birth longitude in decimal degrees.
|
|
|
start_date: ISO date string for the start of the range (YYYY-MM-DD).
|
|
start_date: ISO date string for the start of the range (YYYY-MM-DD).
|
|
|
end_date: ISO date string for the end of the range (YYYY-MM-DD).
|
|
end_date: ISO date string for the end of the range (YYYY-MM-DD).
|
|
|
transit_latitude: Current location latitude. Defaults to birth latitude.
|
|
transit_latitude: Current location latitude. Defaults to birth latitude.
|
|
@@ -512,16 +516,11 @@ async def get_transit_preview(
|
|
|
"""
|
|
"""
|
|
|
from datetime import datetime, timedelta, timezone
|
|
from datetime import datetime, timedelta, timezone
|
|
|
|
|
|
|
|
- from . import storage, astrology
|
|
|
|
|
|
|
+ from . import astrology
|
|
|
|
|
|
|
|
- # Get person data
|
|
|
|
|
- person = await storage.get_person(person_id=person_id)
|
|
|
|
|
- if not person:
|
|
|
|
|
- return {"error": f"person not found: {person_id}"}
|
|
|
|
|
-
|
|
|
|
|
- birth_dt = person["birth_datetime"]
|
|
|
|
|
- birth_lat = person["latitude"]
|
|
|
|
|
- birth_lon = person["longitude"]
|
|
|
|
|
|
|
+ birth_dt = birth_datetime
|
|
|
|
|
+ birth_lat = latitude
|
|
|
|
|
+ birth_lon = longitude
|
|
|
t_lat = transit_latitude if transit_latitude is not None else birth_lat
|
|
t_lat = transit_latitude if transit_latitude is not None else birth_lat
|
|
|
t_lon = transit_longitude if transit_longitude is not None else birth_lon
|
|
t_lon = transit_longitude if transit_longitude is not None else birth_lon
|
|
|
|
|
|
|
@@ -618,8 +617,9 @@ async def get_transit_preview(
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
"input": {
|
|
"input": {
|
|
|
- "person_id": person_id,
|
|
|
|
|
- "person_name": person["name"],
|
|
|
|
|
|
|
+ "birth_datetime": birth_datetime,
|
|
|
|
|
+ "latitude": latitude,
|
|
|
|
|
+ "longitude": longitude,
|
|
|
"start_date": start_date,
|
|
"start_date": start_date,
|
|
|
"end_date": end_date,
|
|
"end_date": end_date,
|
|
|
"min_significance": min_significance,
|
|
"min_significance": min_significance,
|
|
@@ -874,17 +874,13 @@ async def _get_person_birth_data(person_id: str) -> dict[str, Any]:
|
|
|
@mcp.tool()
|
|
@mcp.tool()
|
|
|
async def calculate_natal_chart_by_id(
|
|
async def calculate_natal_chart_by_id(
|
|
|
person_id: str,
|
|
person_id: str,
|
|
|
- transit_latitude: float | None = None,
|
|
|
|
|
- transit_longitude: float | None = None,
|
|
|
|
|
house_system: str = "placidus",
|
|
house_system: str = "placidus",
|
|
|
orb_limits: dict[str, float] | None = None,
|
|
orb_limits: dict[str, float] | None = None,
|
|
|
) -> dict[str, Any]:
|
|
) -> dict[str, Any]:
|
|
|
"""Calculate natal chart for a person from the database.
|
|
"""Calculate natal chart for a person from the database.
|
|
|
|
|
|
|
|
Args:
|
|
Args:
|
|
|
- person_id: ID of a person in the persons database.
|
|
|
|
|
- transit_latitude: Override latitude for chart calculation. Defaults to birth latitude.
|
|
|
|
|
- transit_longitude: Override longitude for chart calculation. Defaults to birth longitude.
|
|
|
|
|
|
|
+ person_id: ID or nickname of a person in the persons database.
|
|
|
house_system: House system (default: Placidus).
|
|
house_system: House system (default: Placidus).
|
|
|
orb_limits: Optional orb configuration.
|
|
orb_limits: Optional orb configuration.
|
|
|
|
|
|
|
@@ -896,8 +892,8 @@ async def calculate_natal_chart_by_id(
|
|
|
return birth
|
|
return birth
|
|
|
return await calculate_natal_chart(
|
|
return await calculate_natal_chart(
|
|
|
birth_datetime=birth["birth_datetime"],
|
|
birth_datetime=birth["birth_datetime"],
|
|
|
- latitude=transit_latitude if transit_latitude is not None else birth["latitude"],
|
|
|
|
|
- longitude=transit_longitude if transit_longitude is not None else birth["longitude"],
|
|
|
|
|
|
|
+ latitude=birth["latitude"],
|
|
|
|
|
+ longitude=birth["longitude"],
|
|
|
elevation=birth.get("elevation", 0.0),
|
|
elevation=birth.get("elevation", 0.0),
|
|
|
house_system=house_system,
|
|
house_system=house_system,
|
|
|
orb_limits=orb_limits,
|
|
orb_limits=orb_limits,
|
|
@@ -1023,29 +1019,31 @@ async def get_transit_preview_by_id(
|
|
|
end_date: str,
|
|
end_date: str,
|
|
|
transit_latitude: float | None = None,
|
|
transit_latitude: float | None = None,
|
|
|
transit_longitude: float | None = None,
|
|
transit_longitude: float | None = None,
|
|
|
- orb_limits: dict[str, float] | None = None,
|
|
|
|
|
|
|
+ min_significance: float = 0.0,
|
|
|
) -> dict[str, Any]:
|
|
) -> dict[str, Any]:
|
|
|
- """Preview transit events for a person from the database.
|
|
|
|
|
|
|
+ """Daily transit-to-natal aspect snapshot for a person from the database.
|
|
|
|
|
|
|
|
Args:
|
|
Args:
|
|
|
- person_id: ID of a person in the persons database.
|
|
|
|
|
- start_date: ISO date string for the start of the range.
|
|
|
|
|
- end_date: ISO date string for the end of the range.
|
|
|
|
|
|
|
+ person_id: ID or nickname of a person in the persons database.
|
|
|
|
|
+ start_date: ISO date string for the start of the range (YYYY-MM-DD).
|
|
|
|
|
+ end_date: ISO date string for the end of the range (YYYY-MM-DD).
|
|
|
transit_latitude: Current location latitude. Defaults to birth latitude.
|
|
transit_latitude: Current location latitude. Defaults to birth latitude.
|
|
|
transit_longitude: Current location longitude. Defaults to birth longitude.
|
|
transit_longitude: Current location longitude. Defaults to birth longitude.
|
|
|
- orb_limits: Optional orb configuration.
|
|
|
|
|
|
|
+ min_significance: Minimum significance score (0-10). Default 0 = all.
|
|
|
|
|
|
|
|
Returns:
|
|
Returns:
|
|
|
- List of transit events.
|
|
|
|
|
|
|
+ Daily snapshots with active transit-to-natal aspects.
|
|
|
"""
|
|
"""
|
|
|
birth = await _get_person_birth_data(person_id)
|
|
birth = await _get_person_birth_data(person_id)
|
|
|
if "error" in birth:
|
|
if "error" in birth:
|
|
|
return birth
|
|
return birth
|
|
|
return await get_transit_preview(
|
|
return await get_transit_preview(
|
|
|
- person_id=person_id,
|
|
|
|
|
|
|
+ birth_datetime=birth["birth_datetime"],
|
|
|
|
|
+ latitude=birth["latitude"],
|
|
|
|
|
+ longitude=birth["longitude"],
|
|
|
start_date=start_date,
|
|
start_date=start_date,
|
|
|
end_date=end_date,
|
|
end_date=end_date,
|
|
|
- transit_latitude=transit_latitude if transit_latitude is not None else birth["latitude"],
|
|
|
|
|
- transit_longitude=transit_longitude if transit_longitude is not None else birth["longitude"],
|
|
|
|
|
- min_significance=0.0,
|
|
|
|
|
|
|
+ transit_latitude=transit_latitude,
|
|
|
|
|
+ transit_longitude=transit_longitude,
|
|
|
|
|
+ min_significance=min_significance,
|
|
|
)
|
|
)
|