w
This commit is contained in:
+13
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user