refactor: drop skill file, rework client

This commit was merged in pull request #3.
This commit is contained in:
2026-07-11 08:52:55 +00:00
parent 990a8d09b6
commit a6a288103c
21 changed files with 679 additions and 645 deletions
+16 -4
View File
@@ -1,20 +1,31 @@
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod/v4";
import { EwsClient, loadConfig } from "../ews_client.ts";
import { loadConfig } from "../utils/login.ts";
import { EwsClient } from "../client/ews_client.ts";
export function registerFolderTools(server: McpServer): void {
server.registerTool(
"get_folders",
{
description: "List mail folders from the Exchange mailbox",
description: "List mailbox folders from the Exchange mailbox.",
inputSchema: z.object({
parentFolderId: z.string().default("msgfolderroot").describe(
"Parent folder to list children of (default: msgfolderroot)",
"Parent folder to list children of."
+ " Supports distinguished names (e.g. inbox, calendar)",
),
recursive: z.boolean().default(false).describe(
"If True, traverse all subfolders recursively",
"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 {
@@ -23,6 +34,7 @@ export function registerFolderTools(server: McpServer): void {
return {
content: [{ type: "text" as const, text: JSON.stringify(folders) }],
structuredContent: { folders },
};
} catch (error: any) {
return {