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) {
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively communicates the critical side effect that the browser context is recreated and explicitly notes that cookies and state are preserved, which is essential information for an agent managing browser automation state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description consists of exactly two sentences with zero waste: the first establishes purpose and the second discloses the recreation side effect. Information is front-loaded and appropriately sized for a single-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (single string parameter, no output schema, no nested objects), the description is complete. It covers the operation's purpose and the important behavioral implications of context recreation without needing to describe return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% coverage ('User agent string'), establishing a baseline of 3. The description confirms the parameter's purpose ('Set the browser user agent string') but adds no additional semantic detail regarding format, expected values, or validation constraints beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Set') and target resource ('browser user agent string'). While it doesn't explicitly name sibling alternatives, the specificity of the resource distinguishes it from related tools like pilot_set_cookie or pilot_set_header.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implicit usage guidance by disclosing the recreation cost ('Recreates the browser context'), suggesting this operation has overhead and shouldn't be called excessively. However, it lacks explicit when-to-use/when-not-to-use guidance or comparison to alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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