/** * HttpHandlerFactory — Runtime Fetch Proxy Builder * * Builds handler functions that proxy MCP tool calls to REST API endpoints. * Used by the runtime mode (`loadOpenAPI`). * * @module */ import type { ApiAction } from '../parser/types.js'; /** Runtime context for HTTP proxy handlers */ export interface HttpContext { readonly baseUrl: string; readonly headers?: Record; readonly fetchFn?: typeof fetch; } /** A tool handler function */ export type HandlerFn = (ctx: HttpContext, args: Record) => Promise; /** * Build a handler function for a single API action. * * The handler: * 1. Interpolates path params into the URL * 2. Appends query params * 3. Sends JSON body for POST/PUT/PATCH * 4. Returns the JSON response * * @param action - The API action to build a handler for * @returns A handler function */ export declare function buildHandler(action: ApiAction): HandlerFn; //# sourceMappingURL=HttpHandlerFactory.d.ts.map