start_instance
Launch an Ubuntu desktop sandbox to browse the web or execute code, then access the stream URL to monitor the instance in real time.
Instructions
Start a Scrapybara Ubuntu instance. Use it as a desktop sandbox to access the web or run code. Always present the stream URL to the user afterwards so they can watch the instance in real time.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:116-144 (handler)Handler for the 'start_instance' tool. Starts a new Scrapybara Ubuntu instance, initializes the browser, optionally authenticates using AUTH_STATE_ID, retrieves the stream URL, and returns the instance details including the stream URL.
case "start_instance": { const instance = await client.startUbuntu(); await instance.browser.start({ abortSignal: currentController.signal, }); if (process.env.AUTH_STATE_ID) { await instance.browser.authenticate( { authStateId: process.env.AUTH_STATE_ID, }, { abortSignal: currentController.signal } ); } const streamUrlResponse = await instance.getStreamUrl({ abortSignal: currentController.signal, }); const streamUrl = streamUrlResponse.streamUrl; return { content: [ { type: "text", text: JSON.stringify({ ...instance, streamUrl }, null, 2), } as TextContent, ], }; } - src/schemas.ts:10-10 (schema)Zod schema definition for the 'start_instance' tool input parameters (no parameters required).
export const StartInstanceSchema = z.object({}); - src/index.ts:72-77 (registration)Registration of the 'start_instance' tool in the ListToolsRequestHandler, including name, description, and input schema.
{ name: "start_instance", description: "Start a Scrapybara Ubuntu instance. Use it as a desktop sandbox to access the web or run code. Always present the stream URL to the user afterwards so they can watch the instance in real time.", inputSchema: zodToJsonSchema(StartInstanceSchema), },