/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { sandboxProxyBrowserPortRequest } from "../../funcs/sandboxProxyBrowserPortRequest.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.ProxyBrowserPortRequestRequest$inboundSchema, }; export const tool$sandboxProxyBrowserPortRequest: ToolDefinition = { name: "sandbox-proxy-browser-port-request", description: `Proxy Browser Port Request Proxy an HTTP request to an exposed browser-session port through the gateway. Use the URL returned by \`GET /sessions/{session_id}/browser-url\` as the base. Insert CDP subpaths such as \`json/version\` or \`json/list\` before its query string, preserving the \`session_token\` parameter. This low-level proxy is intended for browser sessions on port \`9222\` and still requires the normal MKA1 API-key authorization header.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await sandboxProxyBrowserPortRequest( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value; return formatResult(value, apiCall); }, };