export type GetApiApiV1McpArgs = {'X-Query-Validation'?: 'strict' | undefined, 'Mcp-Session-Id'?: string | undefined, 'MCP-Protocol-Version'?: ('2025-11-25' | '2025-06-18' | '2025-03-26' | '2024-11-05') | undefined}; export type GetApiApiV1McpOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * MCP GET: no server-to-client stream (405) * * GET /api/v1/mcp * * Also accepts auth: oauth2 */ export const getApiApiV1Mcp = async (args: GetApiApiV1McpArgs, options?: GetApiApiV1McpOptions) => { const {baseUrl = "https://api.0xinsider.com", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Query-Validation'] != null) headers.set("X-Query-Validation", String(args['X-Query-Validation'])) if (args['Mcp-Session-Id'] != null) headers.set("Mcp-Session-Id", String(args['Mcp-Session-Id'])) if (args['MCP-Protocol-Version'] != null) headers.set("MCP-Protocol-Version", String(args['MCP-Protocol-Version'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/mcp${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };