brightspace-mcp-server 3.7.0 → 3.7.1

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.
@@ -4,7 +4,7 @@
4
4
  * Licensed under MIT — see LICENSE file for details.
5
5
  */
6
6
  import { GetCalendarEventsSchema } from "./schemas.js";
7
- import { toolResponse, sanitizeError } from "./tool-helpers.js";
7
+ import { toolResponse, errorResponse, sanitizeError } from "./tool-helpers.js";
8
8
  import { log } from "../utils/logger.js";
9
9
  import { resolveCourses } from "./resolve-courses.js";
10
10
  import { fetchCourseCalendarEvents } from "./calendar-events.js";
@@ -23,6 +23,12 @@ export function registerGetCalendarEvents(server, apiClient, config) {
23
23
  const { courseId, from, to, includeGenerated } = GetCalendarEventsSchema.parse(args);
24
24
  const windowStart = from ? new Date(from).getTime() : Date.now();
25
25
  const windowEnd = to ? new Date(to).getTime() : windowStart + DEFAULT_WINDOW_MS;
26
+ // An inverted window matches nothing, and an empty list reads as "no events".
27
+ if (windowEnd < windowStart) {
28
+ return errorResponse(from
29
+ ? `to (${to}) is before from (${from}). Pass a to that is on or after from.`
30
+ : `to (${to}) is in the past, and from defaults to now. Pass from as well to look at past events.`);
31
+ }
26
32
  const courses = await resolveCourses(apiClient, config, courseId);
27
33
  const results = await Promise.allSettled(courses.map((course) => fetchCourseCalendarEvents(apiClient, config.baseUrl, course, windowStart, windowEnd)));
28
34
  const events = results
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brightspace-mcp-server",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "mcpName": "io.github.rohanmuppa/brightspace",
5
5
  "description": "MCP server for Brightspace (D2L). Check grades, due dates, assignments, announcements, syllabus, rosters and more via Claude, ChatGPT, Cursor, Windsurf, or any MCP client.",
6
6
  "type": "module",