Conversation
- Add missing cal-api-version overrides for event-types (2024-06-14) and schedules (2024-06-11) endpoints that were causing 404 errors - Fix path matching to use first segment so sub-paths like event-types/123 resolve to the correct version override - Improve error reporting to include response body details (e.g. nested errors array) so LLMs can understand why a request was rejected - Enhance create_booking to support eventTypeSlug + username/teamSlug as an alternative to eventTypeId, matching the Cal.com API v2 contract - Add tests for new version overrides and slug-based booking creation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Replace 40-language enum in addBookingAttendee with z.string() (~100 tokens saved) - Shorten verbose/truncated .describe() strings across all tool files (~200 tokens saved) - Drop pretty-printing in ok() — JSON.stringify(data) instead of JSON.stringify(data, null, 2) (~30% smaller responses)
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
romitg2
approved these changes
Apr 6, 2026
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
Multiple MCP server tools (
get_event_types,get_event_type,get_schedules, etc.) were returning 404 errors because thecal-api-versionheader sent to the Cal.com API v2 didn't match the version each NestJS controller is pinned to. The API uses custom header-based versioning — a mismatched version means NestJS can't match the route and returns 404.Root cause: The version override map only had an entry for
slots. Theevent-typesandschedulescontrollers are pinned to older versions (2024-06-14and2024-06-11respectively), but the MCP server was sending the default2024-08-13for those paths.Secondary issue: The override lookup did exact path matching (
event-typesmatched butevent-types/123did not). Changed to match on the first path segment so sub-paths resolve correctly.Additional improvements:
errorsarray from Cal.com API validation responses, so LLMs can understand why a request failedcreate_bookingnow supportseventTypeSlug+username/teamSlugas an alternative toeventTypeId, matching the Cal.com API v2 contractToken overhead reduction
Reduced per-tool-call token cost across all tool schemas and responses:
addBookingAttendee— replaced withz.string().describe("ISO 639-1 language code (e.g. 'en')")(~100 tokens saved per schema emission). Validation is deferred to the API..describe()strings across all tool files — removed verbose/redundant phrasing and fixed truncated descriptions (e.g. routing-forms had descriptions cut off mid-sentence). ~200 tokens saved per full tool listing.ok()—JSON.stringify(data)instead ofJSON.stringify(data, null, 2). ~30% smaller responses, which compounds across multi-turn conversations.Review & Testing Checklist for Human
event-types → 2024-06-14,schedules → 2024-06-11,slots → 2024-09-04. These were derived from reading the Cal.com API v2 NestJS controller decorators — please cross-check against the live API or the latest controller source to confirm they haven't changed.get_event_types,get_event_type(by ID),get_schedules, andget_availability(with eventTypeId) all return data instead of 404s.create_bookingwith slug: Try booking viaeventTypeSlug+usernameinstead ofeventTypeIdto confirm the API accepts it. Note: there is no client-side validation that at least one identification method is provided — validation is deferred to the API..describe()strings still convey enough information for LLMs to use the tools correctly. In particular, check thataddBookingAttendee'slanguagefield (nowz.string()) doesn't cause issues when invalid codes are sent — the API should reject them, but confirm the error is surfaced properly.path.split("/")[0]instead of exact match. Confirm no other endpoint paths start withevent-types,schedules, orslotsthat would be incorrectly matched.Notes
create_bookingchange makeseventTypeIdoptional at the schema level. The Cal.com API itself enforces that eithereventTypeIdoreventTypeSlug + username/teamSlugmust be present — no MCP-side validation was added to avoid duplicating that logic.formatApiError, so LLMs will see the rejection reason.Link to Devin session: https://app.devin.ai/sessions/9e7d8dde273748c789857ef44eddbb9b
Requested by: @sahitya-chandra