Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 09677d2

Browse files
list schedule meetings tool
1 parent e31b3c9 commit 09677d2

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

‎common/types.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,25 @@ export const ZoomMeetingSchema = z.object({
8989
creation_source: z.string(),
9090
pre_schedule: z.boolean(),
9191
});
92+
93+
export const ZoomListMeetingsSchema = z.object({
94+
page_size: z.number(),
95+
total_records: z.number(),
96+
next_page_token: z.string(),
97+
meetings: z.array(
98+
z.object({
99+
uuid: z.string(),
100+
id: z.number(),
101+
host_id: z.string(),
102+
topic: z.string(),
103+
type: z.number(),
104+
start_time: z.string(),
105+
duration: z.number(),
106+
timezone: z.string(),
107+
agenda: z.string(),
108+
created_at: z.string(),
109+
join_url: z.string(),
110+
supportGoLive: z.boolean(),
111+
}),
112+
),
113+
});

‎index.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { zodToJsonSchema } from "zod-to-json-schema";
1010
import {
1111
createMeeting,
1212
CreateMeetingOptionsSchema,
13+
ListMeetingOptionsSchema,
14+
listMeetings,
1315
} from "./operations/meeting.js";
1416
import { z } from "zod";
1517
import { getAccessToken } from "./common/auth.js";
@@ -34,6 +36,11 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
3436
description: "Create a meeting",
3537
inputSchema: zodToJsonSchema(CreateMeetingOptionsSchema),
3638
},
39+
{
40+
name: "list_meetings",
41+
description: "List scheduled meetings",
42+
inputSchema: zodToJsonSchema(ListMeetingOptionsSchema),
43+
},
3744
],
3845
};
3946
});
@@ -52,6 +59,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
5259
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
5360
};
5461
}
62+
63+
case "list_meetings": {
64+
const args = ListMeetingOptionsSchema.parse(request.params.arguments);
65+
const result = await listMeetings(args, token.access_token);
66+
return {
67+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
68+
};
69+
}
5570
}
5671
} catch (error) {
5772
if (error instanceof z.ZodError) {

‎operations/meeting.ts‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { z } from "zod";
22
import { zoomRequest } from "../common/util.js";
3-
import { ZoomMeetingSchema } from "../common/types.js";
3+
import { ZoomListMeetingsSchema,ZoomMeetingSchema } from "../common/types.js";
44

55
export const CreateMeetingOptionsSchema = z.object({
66
agenda: z
@@ -16,7 +16,12 @@ export const CreateMeetingOptionsSchema = z.object({
1616
topic: z.string().max(200).optional().describe("The meeting's topic."),
1717
});
1818

19+
export const ListMeetingOptionsSchema = z.object({
20+
type: z.string().optional().describe("The type of meeting."),
21+
});
22+
1923
export type CreateMeetingOptions = z.infer<typeof CreateMeetingOptionsSchema>;
24+
export type ListMeetingOptions = z.infer<typeof ListMeetingOptionsSchema>;
2025

2126
export async function createMeeting(
2227
options: CreateMeetingOptions,
@@ -32,3 +37,21 @@ export async function createMeeting(
3237
);
3338
return ZoomMeetingSchema.parse(response);
3439
}
40+
41+
export async function listMeetings(options: ListMeetingOptions, token: string) {
42+
let url = "https://api.zoom.us/v2/users/me/meetings";
43+
const params = new URLSearchParams();
44+
Object.entries(options).forEach(([key, value]) => {
45+
if (value !== undefined && value !== null) {
46+
params.append(key, value.toString());
47+
}
48+
});
49+
if (Array.from(params).length > 0) {
50+
url += `?${params.toString()}`;
51+
}
52+
const response = await zoomRequest(url, {
53+
method: "GET",
54+
headers: { Authorization: `Bearer ${token}` },
55+
});
56+
return ZoomListMeetingsSchema.parse(response);
57+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /