timezest-mcp 1.0.1 → 1.0.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.
- package/README.md +3 -3
- package/build/client.js +8 -4
- package/build/index.js +4 -1
- package/build/utils/filter.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,8 +28,8 @@ Add this entry to the `mcpServers` section:
|
|
|
28
28
|
{
|
|
29
29
|
"mcpServers": {
|
|
30
30
|
"timezest": {
|
|
31
|
-
"command": "
|
|
32
|
-
"args": ["-y", "timezest-mcp@latest"],
|
|
31
|
+
"command": "cmd",
|
|
32
|
+
"args": ["/c", "npx", "-y", "timezest-mcp@latest"],
|
|
33
33
|
"env": {
|
|
34
34
|
"TIMEZEST_API_KEY": "YOUR_API_KEY_HERE",
|
|
35
35
|
"TIMEZEST_DEFAULT_TZ": "America/Chicago"
|
|
@@ -43,7 +43,7 @@ Add this entry to the `mcpServers` section:
|
|
|
43
43
|
If you use the terminal-based **Claude Code**, run this single command to add the server globally:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
claude mcp add-json timezest "{\"type\": \"stdio\", \"command\": \"
|
|
46
|
+
claude mcp add-json timezest "{\"type\": \"stdio\", \"command\": \"cmd\", \"args\": [\"/c\", \"npx\", \"-y\", \"timezest-mcp@latest\"], \"env\": {\"TIMEZEST_API_KEY\": \"YOUR_API_KEY_HERE\", \"TIMEZEST_DEFAULT_TZ\": \"America/Chicago\"}}"
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
---
|
package/build/client.js
CHANGED
|
@@ -46,12 +46,16 @@ export class TimeZestClient {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* Fetches
|
|
49
|
+
* Fetches scheduling requests for a configurable window by created_at.
|
|
50
|
+
* Falls back to env vars TIMEZEST_WINDOW_DAYS_BACK / TIMEZEST_WINDOW_DAYS_FORWARD,
|
|
51
|
+
* then to 14 / 30 defaults.
|
|
50
52
|
*/
|
|
51
|
-
async
|
|
53
|
+
async getSchedulingRequests(daysBack, daysForward) {
|
|
54
|
+
const back = daysBack ?? parseInt(process.env.TIMEZEST_WINDOW_DAYS_BACK || '14', 10);
|
|
55
|
+
const forward = daysForward ?? parseInt(process.env.TIMEZEST_WINDOW_DAYS_FORWARD || '30', 10);
|
|
52
56
|
const now = new Date();
|
|
53
|
-
const start = subDays(now,
|
|
54
|
-
const end = addDays(now,
|
|
57
|
+
const start = subDays(now, back);
|
|
58
|
+
const end = addDays(now, forward);
|
|
55
59
|
// API limits filters to created_at
|
|
56
60
|
const params = {
|
|
57
61
|
created_at_after: getUnixTime(start),
|
package/build/index.js
CHANGED
|
@@ -117,8 +117,11 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
117
117
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
118
118
|
const { name, arguments: args } = request.params;
|
|
119
119
|
const appointmentTypes = await client.getAppointmentTypes();
|
|
120
|
-
const rawRequests = await client.getStandardWindowRequests();
|
|
121
120
|
const tz = args?.timezone || process.env.TIMEZEST_DEFAULT_TZ || 'America/Chicago';
|
|
121
|
+
// Determine fetch window from tool-specific args
|
|
122
|
+
const daysBack = args?.days_back;
|
|
123
|
+
const daysForward = args?.days_forward;
|
|
124
|
+
const rawRequests = await client.getSchedulingRequests(daysBack, daysForward);
|
|
122
125
|
const all = rawRequests.map(r => transformAppointment(r, appointmentTypes, tz));
|
|
123
126
|
switch (name) {
|
|
124
127
|
case "get_todays_appointments": {
|
package/build/utils/filter.js
CHANGED
|
@@ -12,9 +12,11 @@ export function filterByDateRange(appointments, startDate, endDate) {
|
|
|
12
12
|
const start = parseISO(startDate);
|
|
13
13
|
const end = parseISO(endDate);
|
|
14
14
|
return appointments.filter(a => {
|
|
15
|
-
|
|
15
|
+
// Use start_time for scheduled appointments, fall back to created_at for pending
|
|
16
|
+
const dateStr = a.start_time || a.created_at;
|
|
17
|
+
if (!dateStr)
|
|
16
18
|
return false;
|
|
17
|
-
const date = parseISO(
|
|
19
|
+
const date = parseISO(dateStr);
|
|
18
20
|
return isWithinInterval(date, { start, end });
|
|
19
21
|
});
|
|
20
22
|
}
|
package/package.json
CHANGED