export type DeleteApiMcpArgs = {'mcp-session-id': string}; export type DeleteApiMcpOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Terminate MCP session * * DELETE /mcp */ export const deleteApiMcp = async (args: DeleteApiMcpArgs, options?: DeleteApiMcpOptions) => { const {baseUrl = "http://localhost:3001", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['mcp-session-id'] != null) headers.set("mcp-session-id", String(args['mcp-session-id'])) const url = `${baseUrl.replace(/\/+$/, '')}/mcp${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };