Extract calendar tool registration for testability #6834

Closed
opened 2026-02-16 18:05:24 -05:00 by yindo · 0 comments
Owner

Originally created by @adolago on GitHub (Jan 19, 2026).

Originally assigned to: @thdxr on GitHub.

Problem

Calendar tool registration is tied to the server entrypoint, which makes it hard to unit test tool handlers with stubbed dependencies.

Proposed fix

  • Create src/mcp/servers/calendar-tools.ts exporting registerCalendarTools(server, deps = defaultDeps).
  • Move all server.tool registrations from src/mcp/servers/calendar.ts into the new module.
  • Update src/mcp/servers/calendar.ts to call registerCalendarTools(server).

Acceptance criteria

  • The calendar server still exposes the same tool set.
  • Tests can inject stubbed dependencies via registerCalendarTools.

Test plan

  • cd packages/agent-core
  • bun test test/mcp/calendar-free-slots.test.ts
Originally created by @adolago on GitHub (Jan 19, 2026). Originally assigned to: @thdxr on GitHub. ## Problem Calendar tool registration is tied to the server entrypoint, which makes it hard to unit test tool handlers with stubbed dependencies. ## Proposed fix - Create `src/mcp/servers/calendar-tools.ts` exporting `registerCalendarTools(server, deps = defaultDeps)`. - Move all `server.tool` registrations from `src/mcp/servers/calendar.ts` into the new module. - Update `src/mcp/servers/calendar.ts` to call `registerCalendarTools(server)`. ## Acceptance criteria - The calendar server still exposes the same tool set. - Tests can inject stubbed dependencies via `registerCalendarTools`. ## Test plan - `cd packages/agent-core` - `bun test test/mcp/calendar-free-slots.test.ts`
yindo closed this issue 2026-02-16 18:05:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6834