planner_items
Retrieve your Canvas planner items for a specified date range using ISO date format. Filter tasks and events between start and end dates.
Instructions
Planner items for the user. ISO dates (YYYY-MM-DD).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_date | No | ||
| end_date | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- canvas_local_mcp/server.py:87-93 (handler)The `planner_items` tool handler function. It accepts optional start/end dates and calls the Canvas API /api/v1/planner/items to retrieve planner items.
@mcp.tool() def planner_items(start_date: str | None = None, end_date: str | None = None) -> list[dict]: """Planner items for the user. ISO dates (YYYY-MM-DD).""" p = {} if start_date: p["start_date"] = start_date if end_date: p["end_date"] = end_date return _get("/api/v1/planner/items", **p) - canvas_local_mcp/server.py:87-88 (registration)The tool is registered via the @mcp.tool() decorator on the function definition.
@mcp.tool() def planner_items(start_date: str | None = None, end_date: str | None = None) -> list[dict]: - canvas_local_mcp/server.py:30-49 (helper)The _get helper function performs the actual HTTP GET request to the Canvas API, handling pagination via Link headers.
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