w
This commit is contained in:
+23
-2
@@ -7,17 +7,37 @@ export function registerPeopleTools(server: McpServer): void {
|
||||
"find_person",
|
||||
{
|
||||
description:
|
||||
"Search for people in the corporate directory (Active Directory) by name, email, or keyword. Returns a list of Person objects with name, email, jobTitle, department, company, office, phones, manager, directReports, and more.",
|
||||
"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 ?? {};
|
||||
@@ -85,6 +105,7 @@ export function registerPeopleTools(server: McpServer): void {
|
||||
|
||||
return {
|
||||
content: [{ type: "text" as const, text: JSON.stringify(people) }],
|
||||
structuredContent: { people },
|
||||
};
|
||||
} catch (error: any) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user