This commit is contained in:
2026-07-10 16:47:35 +03:00
parent 1599bf3981
commit 979e974521
6 changed files with 268 additions and 72 deletions
+13 -4
View File
@@ -6,16 +6,24 @@ export function registerFolderTools(server: McpServer): void {
server.registerTool(
"get_folders",
{
description:
"List mailbox folders from the Exchange mailbox. Returns a list of Folder objects (name, id, totalCount, unreadCount, childFolderCount).",
description: "List mailbox folders from the Exchange mailbox.",
inputSchema: z.object({
parentFolderId: z.string().default("msgfolderroot").describe(
"Parent folder to list children of. Supports distinguished names (e.g. inbox, calendar). Default: msgfolderroot",
"Parent folder to list children of. Supports distinguished names (e.g. inbox, calendar)",
),
recursive: z.boolean().default(false).describe(
"If true, recursively traverse all subfolders. Default: false",
"If true, recursively traverse all subfolders",
),
}),
outputSchema: z.object({
folders: z.array(z.object({
name: z.string(),
id: z.string(),
totalCount: z.number(),
unreadCount: z.number(),
childFolderCount: z.number(),
})),
}),
},
async ({ parentFolderId, recursive }) => {
try {
@@ -24,6 +32,7 @@ export function registerFolderTools(server: McpServer): void {
return {
content: [{ type: "text" as const, text: JSON.stringify(folders) }],
structuredContent: { folders },
};
} catch (error: any) {
return {