Skip to content

delete a meeting #12

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

Merged
merged 1 commit into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand All @@ -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),
},
],
};
});
Expand All @@ -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) {
Expand Down
15 changes: 15 additions & 0 deletions operations/meeting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof CreateMeetingOptionsSchema>;
export type ListMeetingOptions = z.infer<typeof ListMeetingOptionsSchema>;
export type DeleteMeetingOptions = z.infer<typeof DeleteMeetingOptionsSchema>;

export async function createMeeting(options: CreateMeetingOptions) {
const response = await zoomRequest(
Expand Down Expand Up @@ -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;
}