-
Notifications
You must be signed in to change notification settings - Fork 28
feat: add get_event_type_settings MCP tool for team event types #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e2bb63d
2d76f84
287a28f
5bc9b4e
9ddc641
a8bf5af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -466,6 +466,54 @@ export async function updateEventType(params: { | |
| } | ||
| } | ||
|
|
||
| export const getEventTypeSettingsSchema = { | ||
| eventTypeId: z.number().int().describe("Event type ID. Use get_event_types to find this."), | ||
| orgId: z | ||
| .number() | ||
| .int() | ||
| .optional() | ||
| .describe( | ||
| "Organization ID for org-scoped team event types. Use get_me to obtain your organizationId." | ||
| ), | ||
| teamId: z | ||
| .number() | ||
| .int() | ||
| .optional() | ||
| .describe("Team ID for org-scoped team event types. Required together with orgId."), | ||
| }; | ||
|
|
||
| export async function getEventTypeSettings(params: { | ||
| eventTypeId: number; | ||
| orgId?: number; | ||
| teamId?: number; | ||
| }) { | ||
| try { | ||
| const hasOrgId = params.orgId !== undefined; | ||
| const hasTeamId = params.teamId !== undefined; | ||
| if (hasOrgId !== hasTeamId) { | ||
| return { | ||
| content: [ | ||
| { | ||
| type: "text" as const, | ||
| text: "orgId and teamId must be provided together to look up an org-scoped team event type.", | ||
| }, | ||
| ], | ||
| isError: true as const, | ||
| }; | ||
| } | ||
|
|
||
| const path = | ||
| hasOrgId && hasTeamId | ||
| ? `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); | ||
| } | ||
| } | ||
|
Comment on lines
+485
to
+515
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| export const deleteEventTypeSchema = { | ||
| eventTypeId: z | ||
| .number() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.