diff --git a/index.ts b/index.ts index 7a63735..c0bf402 100644 --- a/index.ts +++ b/index.ts @@ -10,11 +10,12 @@ import { zodToJsonSchema } from "zod-to-json-schema"; import { createMeeting, CreateMeetingOptionsSchema, + deleteMeeting, + DeleteMeetingOptionsSchema, ListMeetingOptionsSchema, listMeetings, } from "./operations/meeting.js"; import { z } from "zod"; -import { getAccessToken } from "./common/auth.js"; const server = new Server( { @@ -41,6 +42,11 @@ server.setRequestHandler(ListToolsRequestSchema, async () => { description: "List scheduled meetings", inputSchema: zodToJsonSchema(ListMeetingOptionsSchema), }, + { + name: "delete_meeting", + description: "Delete a meeting with a given ID", + inputSchema: zodToJsonSchema(DeleteMeetingOptionsSchema), + }, ], }; }); @@ -66,6 +72,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } + + case "delete_meeting": { + const args = DeleteMeetingOptionsSchema.parse(request.params.arguments); + const result = await deleteMeeting(args); + return { + content: [{ type: "text", text: result }], + }; + } } } catch (error) { if (error instanceof z.ZodError) { diff --git a/operations/meeting.ts b/operations/meeting.ts index cdfea9a..26c393c 100644 --- a/operations/meeting.ts +++ b/operations/meeting.ts @@ -20,8 +20,13 @@ export const ListMeetingOptionsSchema = z.object({ type: z.string().optional().describe("The type of meeting."), }); +export const DeleteMeetingOptionsSchema = z.object({ + id: z.number().describe("The ID of the meeting to delete."), +}); + export type CreateMeetingOptions = z.infer; export type ListMeetingOptions = z.infer; +export type DeleteMeetingOptions = z.infer; export async function createMeeting(options: CreateMeetingOptions) { const response = await zoomRequest( @@ -50,3 +55,13 @@ export async function listMeetings(options: ListMeetingOptions) { }); return ZoomListMeetingsSchema.parse(response); } + +export async function deleteMeeting(options: DeleteMeetingOptions) { + const response = await zoomRequest( + `https://api.zoom.us/v2/meetings/${options.id}`, + { + method: "DELETE", + }, + ); + return response; +}