Skip to content

Expose continuation tokens in the calendar_events MCP tool #1270

Closed

Description

@pkyIntelligence

The Calendar CLI supports listing events across pages, but the MCP calendar_events input schema has no continuation-token argument. A caller reaching the first page limit cannot continue the same Calendar query through that tool.

At 9e972923686f69c75f5ff21c4afaf5c26f3342ec, the schema exposes calendar/time-window/query selectors and max (up to 250), but no page-token input. The argument builder does not map one to the CLI.

Source: https://github.com/openclaw/gogcli/blob/9e972923686f69c75f5ff21c4afaf5c26f3342ec/internal/cmd/mcp_tools.go

Expected interaction: request a bounded page for one calendar and time window, then pass the response's continuation token with the same selectors to retrieve the next page. This avoids repeatedly subdividing a busy time window merely to enumerate its events.

Would you be open to exposing the existing CLI continuation mechanism as an optional MCP input? We have a downstream implementation and would follow your preferred naming/interface.

Credential-free source check

From a checkout at the revision above:

python3 - <<'PYTHON'
from pathlib import Path
s = Path("internal/cmd/mcp_tools.go").read_text()
b = s.split("func mcpCalendarEventsTool()", 1)[1].split("\nfunc ", 1)[0]
print("MCP page input:", 'WithString("page"' in b)
print("MCP page forwarding:", 'req.GetString("page"' in b)
s = Path("internal/cmd/calendar_events_cmds.go").read_text()
print("CLI page flag:", 'name:"page"' in s)
PYTHON

Observed: MCP page input: False, MCP page forwarding: False, CLI page flag: True. This verifies the interface gap by source inspection, not a live multi-page mailbox/calendar read. No credentials or Google API requests were used.

Investigated and reproduced with AI assistance (the Astrarch agent team); the reproduction was verified on a real host.

Activity

  1. added
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    P2Normal priority bug or improvement with limited blast radius.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    and removed
    clawsweeper:intake:featurePreliminary submission classification; full source review pending.
    on Oct 26, 2026
  2. clawsweeper commented on Oct 26, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    This issue identifies a missing MCP capability on current main; the related open PR adds paginated Calendar search but leaves calendar_events unchanged.

    Reproducibility: Source confirms the absent schema input and argument mapping while the CLI accepts and returns page tokens; no live multi-page Calendar call or tests were run.

    Maintainer decision needed

    • Question: Should calendar_events gain an optional page input independently of the broader Calendar MCP work?
    • Recommendation: Add page to calendar_events: Keep the change focused on the existing tool and forward the opaque token to --page.
    • Why: Current source establishes the missing capability, but neither the discussion nor the overlapping PR settles the intended public interface.

    Next step
    Choose the optional page interface and coordinate its scope with #1181 before implementation.

    Review details

    Best possible solution:

    Provide bounded continuation through calendar_events using the existing CLI page mechanism.

    Do we have a high-confidence way to reproduce the issue?

    Source confirms the absent schema input and argument mapping while the CLI accepts and returns page tokens; no live multi-page Calendar call or tests were run.

    Is this the best way to solve the issue?

    An optional page input is a narrow extension of the typed tool and preserves bounded reads without introducing automatic traversal or broader permissions.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The preferred continuation interface and coordination with the broader open Calendar MCP PR remain undecided.

    Codex review notes: model internal, reasoning medium; reviewed against 9e972923686f.

    Label changes

    Label changes:

    • add P2: A focused MCP capability gap limits busy-calendar enumeration without evidence of an urgent regression.
    • add impact:ux-friction: MCP callers must subdivide time windows or use the CLI to continue an otherwise valid event listing.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.
    • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.
    • add clawsweeper:needs-product-decision: Current issue advisory state selects this label.

    Label justifications:

    • P2: A focused MCP capability gap limits busy-calendar enumeration without evidence of an urgent regression.
    • impact:ux-friction: MCP callers must subdivide time windows or use the CLI to continue an otherwise valid event listing.
    Evidence reviewed

    Acceptance criteria:

    • go test ./internal/cmd -run 'TestMCP|TestListCalendarEvents'
    • make ci

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed October 26, 2026, 3:41 PM ET / 19:41 UTC.

  3. steipete commented on Oct 27, 2026

    @steipete
    Collaborator

    The existing calendar_events MCP tool now accepts optional page input and forwards the opaque continuation token to the bounded CLI event list. A two-page MCP-to-CLI synthetic API regression verifies token forwarding with the same calendar, window, query, and limit.

    Fixed by #1273, merged as 8c5c062. The regression failed on the previous main and passes with the fix. Focused tests, the remote gate, and exact-head CI passed. Independent review found no actionable P0–P2 issues. Thanks @pkyIntelligence.

  4. added a commit that references this issue on Oct 27, 2026
    8c5c062
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions