canvas_get_upcoming_assignments
Retrieve upcoming assignment due dates from Canvas LMS. Specify a limit to control the number of assignments returned, helping users stay organized and manage deadlines effectively.
Instructions
Get upcoming assignment due dates
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of assignments to return |
Input Schema (JSON Schema)
{
"properties": {
"limit": {
"description": "Maximum number of assignments to return",
"type": "number"
}
},
"required": [],
"type": "object"
}
Implementation Reference
- src/client.ts:454-459 (handler)Core handler function that implements the tool logic by calling Canvas API endpoint `/users/self/upcoming_events` and filtering for assignments.async getUpcomingAssignments(limit: number = 10): Promise<CanvasAssignment[]> { const response = await this.client.get('/users/self/upcoming_events', { params: { limit } }); return response.data.filter((event: any) => event.assignment); }
- src/index.ts:1301-1307 (handler)MCP CallToolRequestSchema handler case that receives arguments, calls CanvasClient.getUpcomingAssignments, and returns formatted JSON response.case "canvas_get_upcoming_assignments": { const { limit = 10 } = args as { limit?: number }; const assignments = await this.client.getUpcomingAssignments(limit); return { content: [{ type: "text", text: JSON.stringify(assignments, null, 2) }] }; }
- src/index.ts:356-366 (schema)Tool schema definition with name, description, and inputSchema for 'limit' parameter. Part of TOOLS array.{ name: "canvas_get_upcoming_assignments", description: "Get upcoming assignment due dates", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of assignments to return" } }, required: [] } },
- src/index.ts:1071-1073 (registration)Registration of ListToolsRequestSchema handler that returns the full TOOLS array containing this tool.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));