/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { sandboxGetBrowserUrl } from "../../funcs/sandboxGetBrowserUrl.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetBrowserSessionUrlRequest$inboundSchema, }; export const tool$sandboxGetBrowserUrl: ToolDefinition = { name: "sandbox-get-browser-url", description: `Get Browser Session URL Return the public gateway URL for a browser session's Chrome DevTools Protocol endpoint. Playwright can use this HTTP endpoint directly. For clients that require a WebSocket endpoint, request \`json/version\` and use its rewritten \`webSocketDebuggerUrl\`. Insert subpaths before the query string; for example, use \`/ports/9222/json/version?session_token=...\`. Send the same MKA1 API-key authorization header on the HTTP and WebSocket requests. Standard sessions do not expose a public URL; use the command, code, and workspace operations instead.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await sandboxGetBrowserUrl( 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); }, };