Repository navigation
Conversation
Surface the user's pending activities (the Dashboard "Timeline") via core_calendar_get_action_events_by_timesort, so assistants can answer "what do I have due?" without reaching for the destructive-annotated call_ws_function. - days / overdue_days window, limit up to 200 (paged 50 at a time via aftereventid, since Moodle caps limitnum at 50) - markdown table (due in local time, course, linked activity, status) plus structured data with an ISO-8601 UTC due date and overdue flag - annotated readOnlyHint=true / destructiveHint=false - tests: formatting/sorting, pagination, empty, unconfigured, dispatch, annotations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
list_upcoming_deadlines, a read-only Web Services tool that lists the authenticated user's pending activities — the same data shown in the Moodle Dashboard Timeline block — with due date, course, activity link and an overdue flag.Motivation
Once
MOODLE_URL+MOODLE_TOKENare set, one of the most natural things a student or teacher asks an assistant is "what do I have due this week?". Today the only way to answer that iscall_ws_function, which is (correctly) annotateddestructiveHint=true. As a result, clients prompt for confirmation on every call, and the model has to know the right function name, its argument shape and Moodle's pagination rules.A dedicated tool makes this a one-step, safe, well-formatted call.
What it does
core_calendar_get_action_events_by_timesort, which is part of themoodle_mobile_appservice. Any token issued for the official mobile app works, including on SSO-only sites (Shibboleth, CAS, …) via theadmin/tool/mobile/launch.phpflow.daysoverdue_dayslimitlimitnumat 50 per call, so the tool pages withaftereventid/lastiduntil it reacheslimit. It stops early on a short page or a missing/unchangedlastid, so a misbehaving server can't make it loop.{markdown, data}convention.markdown: a table with due date in local time, course, linked activity, and status (**overdue**or the pending action, e.g. Add submission). Pipes and newlines in cells are escaped.data.deadlines[]:id,name,event,module,course,timesort, an ISO-8601 UTCdue,overdue,actionandurl, plusdata.truncated.readOnlyHint=true,destructiveHint=false.list_ws_functionsandcall_ws_function.Example output
Changes
src/moodle_mcp/tools.py:tool_upcoming_deadlinesplus small helpers_deadline_from_eventand_md_cell.src/moodle_mcp/server.py: tool schema (with bounds) and dispatch.tests/test_ws.py: tests for formatting and sorting, request window params, pagination viaaftereventid, the empty result, the unconfigured case, and the read-only annotations.tests/test_dispatch.py: an end-to-end dispatch test for the unconfigured path.README.md: the tool table, now "Eleven MCP tools".No new dependencies, and existing tools are untouched.
Testing
ruff check .passes.mypypasses.pytest -qpasses, 87 tests, on Python 3.10 and 3.12.🤖 Generated with Claude Code