Skip to main content
Glama

pilot_set_useragent

Set the browser user agent string to simulate different devices or browsers while preserving cookies and session state for web automation tasks.

Instructions

Set the browser user agent string. Recreates the browser context, preserving cookies and state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
useragentYesUser agent string

Implementation Reference

  • The handler implementation for the 'pilot_set_useragent' tool. It sets the user agent on the browser manager and recreates the context.
    server.tool(
      'pilot_set_useragent',
      'Set the browser user agent string. Recreates the browser context, preserving cookies and state.',
      { useragent: z.string().describe('User agent string') },
      async ({ useragent }) => {
        await bm.ensureBrowser();
        try {
          bm.setUserAgent(useragent);
          const error = await bm.recreateContext();
          if (error) {
            return { content: [{ type: 'text' as const, text: `User agent set to "${useragent}" but: ${error}` }] };
          }
          return { content: [{ type: 'text' as const, text: `User agent set: ${useragent}` }] };
        } catch (err) {

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TacosyHorchata/Pilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server