import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { ShapeOutput, ZodRawShapeCompat } from "@modelcontextprotocol/sdk/server/zod-compat.js"; import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js"; import { CallToolResult, ServerNotification, ServerRequest } from "@modelcontextprotocol/sdk/types.js"; import { UapiMcpCore } from "../core.js"; import { ConsoleLogger } from "./console-logger.js"; import { MCPServerFlags } from "./flags.js"; import { MCPScope } from "./scopes.js"; export type ToolDefinition = Args extends ZodRawShapeCompat ? { name: string; description: string; scopes?: MCPScope[]; args: Args; annotations: { title: string; destructiveHint: boolean; idempotentHint: boolean; openWorldHint: boolean; readOnlyHint: boolean; }; tool: (client: UapiMcpCore, args: ShapeOutput, extra: RequestHandlerExtra) => CallToolResult | Promise; } : { name: string; description: string; scopes?: MCPScope[]; args?: undefined; annotations: { title: string; destructiveHint: boolean; idempotentHint: boolean; openWorldHint: boolean; readOnlyHint: boolean; }; tool: (client: UapiMcpCore, extra: RequestHandlerExtra) => CallToolResult | Promise; }; declare function jsonRpcErrorBody(code: number, message: string): { jsonrpc: "2.0"; error: { code: number; message: string; }; id: null; }; export declare function buildTransportErrorResponse(error: unknown): { status: number; body: ReturnType; }; export declare function buildMissingSSESessionResponse(sessionId: string): { status: number; body: { jsonrpc: "2.0"; error: { code: number; message: string; }; id: null; }; }; export declare function formatResult(response: Response): Promise; export declare function createRegisterTool(logger: ConsoleLogger, server: McpServer, getSDK: () => UapiMcpCore, allowedScopes: Set, allowedTools?: Set, dynamic?: boolean): [ (tool: ToolDefinition) => void, Array<{ name: string; description: string; }>, Map> ]; export declare function registerDynamicTools(logger: ConsoleLogger, server: McpServer, getSDK: () => UapiMcpCore, toolMap: Map>, allowedScopes: Set): void; export declare function buildSDK(headers: Headers, cliFlags: MCPServerFlags, disableStaticAuth: boolean, logger: { level: string; }): UapiMcpCore; export {}; //# sourceMappingURL=tools.d.ts.map