todo
View ungraded assignments from Canvas LMS to identify incomplete coursework.
Instructions
User's TODO list (ungraded assignments to look at).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- canvas_local_mcp/server.py:128-130 (handler)The 'todo' tool handler function. Calls the Canvas API /api/v1/users/self/todo endpoint to retrieve the user's TODO list (ungraded assignments). Decorated with @mcp.tool() to register it as an MCP tool.
def todo() -> list[dict]: """User's TODO list (ungraded assignments to look at).""" return _get("/api/v1/users/self/todo") - canvas_local_mcp/server.py:127-128 (registration)The @mcp.tool() decorator on line 127 registers the 'todo' function as an MCP tool named 'todo' with the FastMCP server instance.
@mcp.tool() def todo() -> list[dict]: - canvas_local_mcp/server.py:30-49 (helper)The _get helper function is the underlying HTTP client used by todo() to make the GET request to the Canvas API. It handles pagination, headers, and response parsing.
def _get(path: str, **params) -> Any: params.setdefault("per_page", 100) url = f"{BASE}{path}" out = [] with httpx.Client(headers=HEAD, timeout=30) as c: while url: r = c.get(url, params=params) r.raise_for_status() data = r.json() if isinstance(data, list): out.extend(data) else: return data url = None params = {} link = r.headers.get("Link", "") for part in link.split(","): if 'rel="next"' in part: url = part[part.find("<")+1:part.find(">")] return out