Skip to content

feat: add get_event_type_settings MCP tool for team event types#101

Draft
joeauyeung wants to merge 6 commits into
mainfrom
devin/1780510091-add-round-robin-config-tool
Draft

feat: add get_event_type_settings MCP tool for team event types#101
joeauyeung wants to merge 6 commits into
mainfrom
devin/1780510091-add-round-robin-config-tool

Conversation

@joeauyeung

@joeauyeung joeauyeung commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds get_event_type_settings MCP tool that fetches an event type and returns the full settings as exposed by the Cal.com v2 API — including scheduling type, hosts, locations, booking fields, limits, and all other configuration.

Supports org-scoped team event types via orgId + teamId params (routes to /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}). The response is passed through without transformation.

Registered with READ_ONLY annotations. 4 unit tests cover: full passthrough, org-scoped path routing, arbitrary settings passthrough, and error handling.

Link to Devin session: https://app.devin.ai/sessions/973bb70e965b4c4e9def15bc7fc5012b
Requested by: @joeauyeung

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Instead of cherry-picking specific RR fields, pass through the raw API
response so the tool surfaces whatever event type settings the Cal.com
API exposes.

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
cal-companion-chat Ignored Ignored Jul 10, 2026 5:45pm
cal-companion-mcp Ignored Ignored Jul 10, 2026 5:45pm

Request Review

Renames the MCP tool to better reflect its purpose — it returns
full event type settings, not just round-robin configuration.

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
@devin-ai-integration devin-ai-integration Bot changed the title feat: add get_round_robin_config MCP tool for team event types feat: add get_event_type_settings MCP tool for team event types Jun 5, 2026
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
@joeauyeung joeauyeung marked this pull request as ready for review July 7, 2026 20:57

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

⚠️ 2 issues in files not directly in the diff

⚠️ New tool missing from the README tool table, violating mandatory metadata update rule (apps/mcp-server/README.md:203-212)

The new event-type-settings tool is registered (register-tools.ts:298-308) but not added to the README tool table (apps/mcp-server/README.md:203-212), so the documented tool count and discovery table are stale.

Impact: Developers and LLM clients relying on the README for tool discovery won't know this tool exists.

Rule violation and required changes

The AGENTS.md rule at .agents/rules/api-mcp-openapi-contract.md states:

When a change affects what a tool can do or how it is discovered, update all of:

  • The tool tables in apps/mcp-server/README.md.

The README at apps/mcp-server/README.md:203 still says "### Event Types (7)" and the table doesn't include get_event_type_settings. It should be updated to "(8)" and include a row for the new tool.


⚠️ New tool missing from server instructions, violating mandatory metadata update rule (apps/mcp-server/src/server-instructions.ts:9)

The new event-type-settings tool is registered but not mentioned in the server instructions (apps/mcp-server/src/server-instructions.ts:9), so LLM clients won't know they can retrieve full event type settings.

Impact: LLM clients won't discover or use the new tool since the capabilities list doesn't mention it.

Rule violation and required changes

The AGENTS.md rule at .agents/rules/api-mcp-openapi-contract.md states:

When a change affects what a tool can do or how it is discovered, update all of:

  • Server instructions in apps/mcp-server/src/server-instructions.ts.

The CAPABILITIES section at apps/mcp-server/src/server-instructions.ts:9 says "List, create, update, and delete event types" but doesn't mention the new ability to get full event type settings (including org-scoped team event types). The get_event_type_settings tool should be listed alongside the other event type capabilities.

Open in Devin Review

Comment thread apps/mcp-server/src/tools/event-types.ts
Comment on lines +475 to +491
export async function getEventTypeSettings(params: {
eventTypeId: number;
orgId?: number;
teamId?: number;
}) {
try {
const path =
params.orgId !== undefined && params.teamId !== undefined
? `organizations/${params.orgId}/teams/${params.teamId}/event-types/${params.eventTypeId}`
: `event-types/${params.eventTypeId}`;

const data = await calApi(path);
return ok(data);
} catch (err) {
return handleError("get_event_type_settings", err);
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 New tool is functionally identical to get_event_type for non-org calls

When called without orgId/teamId, getEventTypeSettings at apps/mcp-server/src/tools/event-types.ts:484 calls calApi("event-types/${params.eventTypeId}") — which is exactly what getEventType at apps/mcp-server/src/tools/event-types.ts:56 does. The test at apps/mcp-server/src/tools/event-types.test.ts:208 confirms this overlap. The only differentiation is the org-scoped path when both orgId and teamId are provided. It may be worth clarifying in the tool description that this tool's primary value-add is the org-scoped lookup, or consider whether the org-scoping should be added to the existing get_event_type tool instead of creating a new one.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

❌ Cannot revive Devin session - the session is too old. Please start a new session instead.

1 similar comment
@devin-ai-integration

Copy link
Copy Markdown
Contributor

❌ Cannot revive Devin session - the session is too old. Please start a new session instead.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/mcp-server/src/tools/event-types.ts Outdated

@dhairyashiil dhairyashiil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the existing Devin/Cubic findings on the partial orgId/teamId handling and the missing README/server-instruction updates. One additional blocker I found while checking this against the OpenAPI/source contract:

The new org-scoped path in get_event_type_settings calls organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}, but the MCP server default OAuth scopes do not include TEAM_EVENT_TYPE_READ. Cal's controller for that endpoint requires TEAM_EVENT_TYPE_READ, so HTTP/OAuth users will fail the advertised org-scoped use case unless they manually override CAL_OAUTH_SCOPES.

Evidence:

  • apps/mcp-server/src/tools/event-types.ts routes to organizations/${orgId}/teams/${teamId}/event-types/${eventTypeId} when both IDs are provided.
  • apps/mcp-server/src/config.ts default calOAuthScopes does not include TEAM_EVENT_TYPE_READ.
  • Cal source requires @OAuthPermissions(["TEAM_EVENT_TYPE_READ"]) for GET /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}.

Please add the required scope to the default OAuth scope list, and keep the existing Devin/Cubic fixes for partial org/team inputs and MCP discovery docs.

@github-actions github-actions Bot marked this pull request as draft July 7, 2026 21:12
… for get_event_type_settings

Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Addressed the remaining review findings in 9ddc641:

  • Missing TEAM_EVENT_TYPE_READ scope (@dhairyashiil): added TEAM_EVENT_TYPE_READ to the default calOAuthScopes in apps/mcp-server/src/config.ts, so the org-scoped GET /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId} path works for OAuth/HTTP users without a manual scope override. Also updated the CAL_OAUTH_SCOPES docs in README.md and .env.example.
  • Tool discovery metadata (Devin Review): added a get_event_type_settings row to the README tool table (Event Types 7 → 8) and listed the tool in server-instructions.ts.
  • Partial orgId/teamId handling: now returns an explicit error instead of silently querying the personal endpoint (see inline replies).

Local lint, typecheck, and the mcp-server unit tests pass.

@joeauyeung joeauyeung requested a review from dhairyashiil July 8, 2026 17:51
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants