-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Hi,
I encountered another issue:
When using the canvas_create_course tool, the restrict_enrollments_to_course_dates parameter is not being correctly applied to the Canvas course, even when explicitly set to true by the agent. This results in courses being created with start/end dates, but without enrollment restrictions enabled, as Canvas defaults the value to false. Therefore, the dates are ignored.
Example payload:
{
"account_id": ...,
"name": "Test Course",
"course_code": "TC101",
"start_at": "2025-09-01T09:00:00Z",
"end_at": "2025-12-15T18:00:00Z",
"restrict_enrollments_to_course_dates": true
}
The created Canvas course should have restrict_enrollments_to_course_dates set to true, and enrollments should be restricted by the provided start_at and end_at dates.
Observed Behavior: The created Canvas course has restrict_enrollments_to_course_dates set to false (the default value).
Root Cause Discovered:
Through extensive debugging, I found that the restrict_enrollments_to_course_dates property is missing from the inputSchema definition for the canvas_create_course tool in the MCP server's index.ts file.
The tool's internal processing appears to filter out or ignore any parameters not explicitly defined in its inputSchema before passing them to the underlying Canvas API call. As a result, the Canvas API receives the request without this parameter, causing it to apply its default value (false).