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
+27 -3
View File
@@ -1,22 +1,45 @@
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 registerPeopleTools(server: McpServer): void {
server.registerTool(
"find_person",
{
description: "Search for people in the corporate directory",
description:
"Search for people in the corporate directory (Active Directory)"
+ " by name, email, or keyword.",
inputSchema: z.object({
query: z.string().describe(
"Name, email address, or keyword to search for",
),
}),
outputSchema: z.object({
name: z.string(),
email: z.string(),
mailboxType: z.string(),
firstName: z.string(),
lastName: z.string(),
jobTitle: z.string(),
department: z.string(),
company: z.string(),
office: z.string(),
alias: z.string(),
manager: z.string(),
managerEmail: z.string(),
phones: z.record(z.string(), z.string()),
address: z.string(),
directReports: z.array(z.object({
name: z.string(),
email: z.string(),
})),
}),
},
async ({ query }) => {
try {
const client = new EwsClient(loadConfig());
const resolutions = await client.resolveNames(query, true);
const resolutions = await client.resolveNames(query);
const people = resolutions.map((r: any) => {
const mailbox = r.Mailbox ?? {};
@@ -84,6 +107,7 @@ export function registerPeopleTools(server: McpServer): void {
return {
content: [{ type: "text" as const, text: JSON.stringify(people) }],
structuredContent: { people },
};
} catch (error: any) {
return {