@openephemeris/mcp-server 3.3.2 → 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -277,6 +277,8 @@ export class BackendClient {
277
277
  return new BackendError(`Resource not found: ${msg}`, 404, "not_found", false);
278
278
  if (status === 400)
279
279
  return new BackendError(`Invalid request: ${msg}`, 400, "bad_request", false);
280
+ if (status === 422)
281
+ return new BackendError(`Validation error: ${msg}`, 422, "unprocessable_entity", false);
280
282
  if (status >= 500)
281
283
  return new BackendError(`Backend error (${status}): ${msg}`, status, "server_error", true);
282
284
  }
@@ -34,6 +34,7 @@ registerTool({
34
34
  person_b_timezone: { type: "string", description: "IANA timezone name for Person B, e.g. 'Europe/London'." },
35
35
  person_b_latitude: { type: "number", description: "Person B birth latitude." },
36
36
  person_b_longitude: { type: "number", description: "Person B birth longitude." },
37
+ format: { type: "string", enum: ["json", "llm"], description: "Use 'llm' for token-efficient LLM projection." },
37
38
  },
38
39
  required: [
39
40
  "person_a_datetime", "person_a_latitude", "person_a_longitude",
@@ -46,11 +47,17 @@ registerTool({
46
47
  "person_a_datetime", "person_a_latitude", "person_a_longitude",
47
48
  "person_b_datetime", "person_b_latitude", "person_b_longitude",
48
49
  ]);
49
- return await backendClient.post("/comparative/composite", {
50
- subjects: [
51
- buildSubject("Person A", args.person_a_datetime, args.person_a_latitude, args.person_a_longitude, args.person_a_timezone),
52
- buildSubject("Person B", args.person_b_datetime, args.person_b_latitude, args.person_b_longitude, args.person_b_timezone),
53
- ],
50
+ const query = {};
51
+ if (args.format)
52
+ query.format = args.format;
53
+ return await backendClient.request("POST", "/comparative/composite", {
54
+ params: query,
55
+ data: {
56
+ subjects: [
57
+ buildSubject("Person A", args.person_a_datetime, args.person_a_latitude, args.person_a_longitude, args.person_a_timezone),
58
+ buildSubject("Person B", args.person_b_datetime, args.person_b_latitude, args.person_b_longitude, args.person_b_timezone),
59
+ ],
60
+ }
54
61
  });
55
62
  },
56
63
  });
@@ -71,6 +78,7 @@ registerTool({
71
78
  person_b_timezone: { type: "string", description: "IANA timezone name for Person B, e.g. 'Europe/London'." },
72
79
  person_b_latitude: { type: "number", description: "Person B birth latitude." },
73
80
  person_b_longitude: { type: "number", description: "Person B birth longitude." },
81
+ format: { type: "string", enum: ["json", "llm"], description: "Use 'llm' for token-efficient LLM projection." },
74
82
  },
75
83
  required: [
76
84
  "person_a_datetime", "person_a_latitude", "person_a_longitude",
@@ -83,11 +91,17 @@ registerTool({
83
91
  "person_a_datetime", "person_a_latitude", "person_a_longitude",
84
92
  "person_b_datetime", "person_b_latitude", "person_b_longitude",
85
93
  ]);
86
- return await backendClient.post("/comparative/composite/midpoint", {
87
- subjects: [
88
- buildSubject("Person A", args.person_a_datetime, args.person_a_latitude, args.person_a_longitude, args.person_a_timezone),
89
- buildSubject("Person B", args.person_b_datetime, args.person_b_latitude, args.person_b_longitude, args.person_b_timezone),
90
- ],
94
+ const query = {};
95
+ if (args.format)
96
+ query.format = args.format;
97
+ return await backendClient.request("POST", "/comparative/composite/midpoint", {
98
+ params: query,
99
+ data: {
100
+ subjects: [
101
+ buildSubject("Person A", args.person_a_datetime, args.person_a_latitude, args.person_a_longitude, args.person_a_timezone),
102
+ buildSubject("Person B", args.person_b_datetime, args.person_b_latitude, args.person_b_longitude, args.person_b_timezone),
103
+ ],
104
+ }
91
105
  });
92
106
  },
93
107
  });
@@ -108,6 +122,7 @@ registerTool({
108
122
  person_b_timezone: { type: "string", description: "IANA timezone name for Person B, e.g. 'Europe/London'." },
109
123
  person_b_latitude: { type: "number", description: "Person B birth latitude." },
110
124
  person_b_longitude: { type: "number", description: "Person B birth longitude." },
125
+ format: { type: "string", enum: ["json", "llm"], description: "Use 'llm' for token-efficient LLM projection." },
111
126
  },
112
127
  required: [
113
128
  "person_a_datetime", "person_a_latitude", "person_a_longitude",
@@ -120,11 +135,17 @@ registerTool({
120
135
  "person_a_datetime", "person_a_latitude", "person_a_longitude",
121
136
  "person_b_datetime", "person_b_latitude", "person_b_longitude",
122
137
  ]);
123
- return await backendClient.post("/comparative/overlay", {
124
- subjects: [
125
- buildSubject("Person A", args.person_a_datetime, args.person_a_latitude, args.person_a_longitude, args.person_a_timezone),
126
- buildSubject("Person B", args.person_b_datetime, args.person_b_latitude, args.person_b_longitude, args.person_b_timezone),
127
- ],
138
+ const query = {};
139
+ if (args.format)
140
+ query.format = args.format;
141
+ return await backendClient.request("POST", "/comparative/overlay", {
142
+ params: query,
143
+ data: {
144
+ subjects: [
145
+ buildSubject("Person A", args.person_a_datetime, args.person_a_latitude, args.person_a_longitude, args.person_a_timezone),
146
+ buildSubject("Person B", args.person_b_datetime, args.person_b_latitude, args.person_b_longitude, args.person_b_timezone),
147
+ ],
148
+ }
128
149
  });
129
150
  },
130
151
  });
@@ -145,6 +166,7 @@ registerTool({
145
166
  natal_longitude: { type: "number", description: "Natal birth longitude." },
146
167
  transit_datetime: { type: "string", description: "Transit moment (ISO 8601). Defaults to now." },
147
168
  transit_timezone: { type: "string", description: "IANA timezone name for Transit, e.g. 'America/Denver'. Only applicable if transit_datetime is provided without offset." },
169
+ format: { type: "string", enum: ["json", "llm"], description: "Use 'llm' for token-efficient LLM projection." },
148
170
  },
149
171
  required: ["natal_datetime", "natal_latitude", "natal_longitude"],
150
172
  additionalProperties: false,
@@ -154,12 +176,15 @@ registerTool({
154
176
  const subjects = [
155
177
  buildSubject("Natal", args.natal_datetime, args.natal_latitude, args.natal_longitude, args.natal_timezone),
156
178
  ];
157
- // The transit subject uses the transit datetime or current time
158
179
  if (args.transit_datetime) {
159
180
  subjects.push(buildSubject("Transit", args.transit_datetime, args.natal_latitude, args.natal_longitude, args.transit_timezone));
160
181
  }
161
- return await backendClient.post("/comparative/natal-transits", {
162
- subjects,
182
+ const query = {};
183
+ if (args.format)
184
+ query.format = args.format;
185
+ return await backendClient.request("POST", "/comparative/natal-transits", {
186
+ params: query,
187
+ data: { subjects }
163
188
  });
164
189
  },
165
190
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openephemeris/mcp-server",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
4
4
  "description": "Model Context Protocol server for the Open Ephemeris astronomical computation API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",