Initial commit: Leexi MCP server (read-only, 6 tools)
This commit is contained in:
@@ -0,0 +1,156 @@
|
||||
import { z } from "zod";
|
||||
import { ResponseFormat } from "../types.js";
|
||||
|
||||
// ─── Shared ──────────────────────────────────────────────────────────────────
|
||||
|
||||
const responseFormatField = z
|
||||
.nativeEnum(ResponseFormat)
|
||||
.default(ResponseFormat.MARKDOWN)
|
||||
.describe("Output format: 'markdown' for human-readable or 'json' for structured data");
|
||||
|
||||
const pageField = z
|
||||
.number()
|
||||
.int()
|
||||
.min(1)
|
||||
.default(1)
|
||||
.describe("Page number (1-based)");
|
||||
|
||||
const itemsField = z
|
||||
.number()
|
||||
.int()
|
||||
.min(1)
|
||||
.max(100)
|
||||
.default(20)
|
||||
.describe("Results per page (1–100)");
|
||||
|
||||
// ─── Users ───────────────────────────────────────────────────────────────────
|
||||
|
||||
export const ListUsersInputSchema = z
|
||||
.object({
|
||||
page: pageField,
|
||||
items: itemsField,
|
||||
response_format: responseFormatField,
|
||||
})
|
||||
.strict();
|
||||
|
||||
export type ListUsersInput = z.infer<typeof ListUsersInputSchema>;
|
||||
|
||||
// ─── Teams ───────────────────────────────────────────────────────────────────
|
||||
|
||||
export const ListTeamsInputSchema = z
|
||||
.object({
|
||||
page: pageField,
|
||||
items: itemsField,
|
||||
response_format: responseFormatField,
|
||||
})
|
||||
.strict();
|
||||
|
||||
export type ListTeamsInput = z.infer<typeof ListTeamsInputSchema>;
|
||||
|
||||
// ─── Calls (list) ────────────────────────────────────────────────────────────
|
||||
|
||||
export const ListCallsInputSchema = z
|
||||
.object({
|
||||
page: pageField,
|
||||
items: itemsField,
|
||||
order: z
|
||||
.enum([
|
||||
"created_at desc",
|
||||
"created_at asc",
|
||||
"performed_at desc",
|
||||
"performed_at asc",
|
||||
"updated_at desc",
|
||||
"updated_at asc",
|
||||
])
|
||||
.default("performed_at desc")
|
||||
.describe("Sort order"),
|
||||
date_filter: z
|
||||
.enum(["created_at", "performed_at", "updated_at"])
|
||||
.default("performed_at")
|
||||
.describe("Which date field the from/to filters apply to"),
|
||||
from: z
|
||||
.string()
|
||||
.optional()
|
||||
.describe("Start date filter (ISO 8601, e.g. 2024-06-01T00:00:00.000Z)"),
|
||||
to: z
|
||||
.string()
|
||||
.optional()
|
||||
.describe("End date filter (ISO 8601)"),
|
||||
source: z
|
||||
.string()
|
||||
.optional()
|
||||
.describe("Integration slug filter (e.g. 'aircall', 'gmeet_bot')"),
|
||||
owner_uuid: z
|
||||
.array(z.string())
|
||||
.optional()
|
||||
.describe("Filter by owner user UUID(s)"),
|
||||
participating_user_uuid: z
|
||||
.array(z.string())
|
||||
.optional()
|
||||
.describe("Filter by participating user UUID(s)"),
|
||||
customer_email_address: z
|
||||
.array(z.string())
|
||||
.optional()
|
||||
.describe("Filter by customer email address(es)"),
|
||||
customer_phone_number: z
|
||||
.array(z.string())
|
||||
.optional()
|
||||
.describe("Filter by customer phone number(s)"),
|
||||
with_simple_transcript: z
|
||||
.boolean()
|
||||
.default(false)
|
||||
.describe("Include paragraph-level transcript in list results"),
|
||||
response_format: responseFormatField,
|
||||
})
|
||||
.strict();
|
||||
|
||||
export type ListCallsInput = z.infer<typeof ListCallsInputSchema>;
|
||||
|
||||
// ─── Call (detail) ───────────────────────────────────────────────────────────
|
||||
|
||||
export const GetCallInputSchema = z
|
||||
.object({
|
||||
uuid: z.string().describe("Call UUID"),
|
||||
response_format: responseFormatField,
|
||||
})
|
||||
.strict();
|
||||
|
||||
export type GetCallInput = z.infer<typeof GetCallInputSchema>;
|
||||
|
||||
// ─── Meeting Events (list) ───────────────────────────────────────────────────
|
||||
|
||||
export const ListMeetingEventsInputSchema = z
|
||||
.object({
|
||||
page: pageField,
|
||||
items: itemsField,
|
||||
order: z
|
||||
.enum([
|
||||
"created_at desc",
|
||||
"created_at asc",
|
||||
"start_time desc",
|
||||
"start_time asc",
|
||||
"end_time desc",
|
||||
"end_time asc",
|
||||
])
|
||||
.default("start_time desc")
|
||||
.describe("Sort order"),
|
||||
created_by: z
|
||||
.enum(["calendar", "manual", "api"])
|
||||
.optional()
|
||||
.describe("Filter by origin type"),
|
||||
response_format: responseFormatField,
|
||||
})
|
||||
.strict();
|
||||
|
||||
export type ListMeetingEventsInput = z.infer<typeof ListMeetingEventsInputSchema>;
|
||||
|
||||
// ─── Meeting Event (detail) ──────────────────────────────────────────────────
|
||||
|
||||
export const GetMeetingEventInputSchema = z
|
||||
.object({
|
||||
uuid: z.string().describe("Meeting event UUID"),
|
||||
response_format: responseFormatField,
|
||||
})
|
||||
.strict();
|
||||
|
||||
export type GetMeetingEventInput = z.infer<typeof GetMeetingEventInputSchema>;
|
||||
Reference in New Issue
Block a user