/** * @fileoverview Glean Model Context Protocol (MCP) Server Implementation * * This server implements the Model Context Protocol, providing a standardized interface * for AI models to interact with Glean's search and chat capabilities. It uses stdio * for communication and implements the MCP specification for tool discovery and execution. * * The server provides two main tools: * 1. search - Allows searching through Glean's indexed content * 2. chat - Enables conversation with Glean's AI assistant */ import { CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js'; import { z } from 'zod'; import { GleanError } from './common/errors.js'; export declare const TOOL_NAMES: { companySearch: string; peopleProfileSearch: string; chat: string; }; /** * Returns the list of available tools with descriptions & JSON Schemas. */ export declare function listToolsHandler(): Promise<{ tools: { name: string; description: string; inputSchema: import("zod-to-json-schema").JsonSchema7Type & { $schema?: string | undefined; definitions?: { [key: string]: import("zod-to-json-schema").JsonSchema7Type; } | undefined; }; }[]; }>; /** * Executes a tool based on the MCP callTool request. */ export declare function callToolHandler(request: z.infer): Promise<{ content: { type: string; text: string; }[]; isError: boolean; }>; /** * Formats a GleanError into a human-readable error message. * This function provides detailed error messages based on the specific error type. * * @param {GleanError} error - The error to format * @returns {string} A formatted error message */ export declare function formatGleanError(error: GleanError): string; /** * Initializes and starts the MCP server using stdio transport. * This is the main entry point for the server process. * * @async * @param {Object} options - Options for server initialization * @param {string} [options.instance] - The Glean instance name from the command line * @param {string} [options.token] - The Glean API token from the command line * @throws {Error} If server initialization or connection fails */ export declare function runServer(options?: { instance?: string; token?: string; }): Promise; //# sourceMappingURL=server.d.ts.map