Skip to main content
Glama

delete_profile

Remove a specific Hyperbrowser profile by its ID to manage user data and optimize storage within the AI-driven browser automation platform.

Instructions

Deletes an existing persistent Hyperbrowser profile.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profileIdYesID of the profile to delete

Implementation Reference

  • The handler function that executes the delete_profile tool logic. It takes a profileId, gets a Hyperbrowser client, calls client.profiles.delete(profileId), and returns success or error content.
    export async function deleteProfileTool( params: deleteProfileToolParamSchemaType, extra: RequestHandlerExtra<ServerRequest, ServerNotification> ): Promise<CallToolResult> { const { profileId } = params; // Destructure validated profileId let apiKey: string | undefined = undefined; if (extra.authInfo && extra.authInfo.extra?.isSSE) { apiKey = extra.authInfo.token; } try { const client = await getClient({ hbApiKey: apiKey }); // Get client instance // Call the SDK delete method await client.profiles.delete(profileId); // Return success return { content: [ { type: "text", text: `Successfully deleted profile with ID: ${profileId}`, }, ], isError: false, }; } catch (error: any) { let errorMessage = `An unknown error occurred while deleting profile ${profileId}.`; let isError = true; // Check if it's a specific Hyperbrowser SDK error if (error instanceof HyperbrowserError) { if (error.statusCode === 404) { errorMessage = `Profile with ID ${profileId} not found.`; // Optionally, you might decide this isn't a true 'error' state for the tool // isError = false; // Depending on desired behavior } else { errorMessage = `Failed to delete profile ${profileId}: ${ error.message } (Status: ${error.statusCode || "N/A"})`; } } else if (error instanceof Error) { errorMessage = `Failed to delete profile ${profileId}: ${error.message}`; } // Return error result return { content: [{ type: "text", text: errorMessage }], isError: isError, }; } }
  • Zod schema definition for delete_profile tool parameters, including profileId as a required string.
    export const deleteProfileToolParamSchemaRaw = { profileId: z.string().describe("ID of the profile to delete"), }; export const deleteProfileToolParamSchema = z.object( deleteProfileToolParamSchemaRaw ); export type deleteProfileToolParamSchemaType = z.infer< typeof deleteProfileToolParamSchema >;
  • Registration of the delete_profile tool on the MCP server using server.tool() with name, description, param schema, and handler.
    deleteProfileToolName, deleteProfileToolDescription, deleteProfileToolParamSchemaRaw, deleteProfileTool );
  • Exports the tool name and description used for registration.
    export const deleteProfileToolName = "delete_profile"; export const deleteProfileToolDescription = "Deletes an existing persistent Hyperbrowser profile.";

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