Skip to main content
Glama

create_profile

Create a new persistent browser profile for AI agents to maintain session data and preferences across automation tasks.

Instructions

Creates a new persistent Hyperbrowser profile.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the create_profile tool. It retrieves an API key from auth info, gets a client instance, calls client.profiles.create() to create a new profile, and returns the profile ID or an error message.
    export async function createProfileTool(
      params: {},
      extra: RequestHandlerExtra<ServerRequest, ServerNotification>
    ): Promise<CallToolResult> {
      let apiKey: string | undefined = undefined;
      if (extra.authInfo && extra.authInfo.extra?.isSSE) {
        apiKey = extra.authInfo.token;
        // You can use extra.authInfo here
      }
    
      try {
        const client = await getClient({ hbApiKey: apiKey }); // Get client instance
    
        // Call the SDK create method
        const response = await client.profiles.create(); // response is { id: string }
    
        // Return success with the profile ID
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2),
            },
          ],
          isError: false,
        };
      } catch (error: any) {
        let errorMessage = "An unknown error occurred while creating the profile.";
    
        // Check if it's a specific Hyperbrowser SDK error
        if (error instanceof HyperbrowserError) {
          errorMessage = `Failed to create profile: ${error.message} (Status: ${
            error.statusCode || "N/A"
          })`;
        } else if (error instanceof Error) {
          errorMessage = `Failed to create profile: ${error.message}`;
        }
    
        // Return error result
        return {
          content: [{ type: "text", text: errorMessage }],
          isError: true,
        };
      }
    }
  • Registers the create_profile tool with the MCP server, using the exported name, description, an empty parameter schema object, and the handler function.
    server.tool(
      createProfileToolName,
      createProfileToolDescription,
      {}, // createProfileToolParamSchemaRaw is just an empty object
      createProfileTool
    );
  • Exports the tool name 'create_profile' and its description for use in registration.
    // Export name and description separately for registration
    export const createProfileToolName = "create_profile";
    export const createProfileToolDescription =
      "Creates a new persistent Hyperbrowser profile.";
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool creates a 'persistent' profile, which hints at long-term storage, but doesn't clarify what 'persistent' entails (e.g., durability, storage location). It omits critical details like authentication requirements, error conditions (e.g., if a profile already exists), or side effects. This is inadequate for a mutation tool with zero annotation coverage.

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 is a single, efficient sentence with zero waste. It's front-loaded with the core action ('Creates'), and every word ('new persistent Hyperbrowser profile') adds meaningful context without fluff. This is optimally concise for the tool's purpose.

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

Completeness2/5

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

Given this is a mutation tool (creates) with no annotations and no output schema, the description is incomplete. It lacks information on what the tool returns (e.g., profile ID, success status), error handling, or behavioral nuances like idempotency. The agent would struggle to use this effectively without trial and error.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, avoiding redundancy. A baseline of 4 is applied since the schema fully handles parameters, and the description doesn't add unnecessary information.

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 action ('Creates') and resource ('new persistent Hyperbrowser profile'), making the purpose unambiguous. It doesn't explicitly differentiate from sibling tools like 'list_profiles' or 'delete_profile', but the verb 'Creates' inherently distinguishes it from read/delete operations. A 5 would require explicit sibling differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., whether a profile must not already exist), when it's appropriate versus using 'list_profiles' first, or any constraints. This leaves the agent without contextual usage instructions.

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/hyperbrowserai/mcp'

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