Skip to main content
Glama
gologinapp

GoLogin MCP

Official
by gologinapp

delete_workspaces__wid__profiles

Remove multiple browser profiles from a specific workspace on GoLogin MCP. Input the workspace ID and profile list to execute the deletion.

Instructions

Delete multiple profiles in workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profilesYes
widYes

Implementation Reference

  • Key matching logic in the dynamic tool handler 'callDynamicTool' that identifies the DELETE /workspaces/{wid}/profiles operation for the tool name 'delete_workspaces__wid__profiles' using the name generation formula and then constructs and executes the HTTP request to the GoLogin API.
    for (const [path, pathItem] of Object.entries(this.apiSpec.paths)) {
      if (!pathItem) continue;
    
      for (const [method, op] of Object.entries(pathItem)) {
        if (['get', 'post', 'put', 'delete', 'patch', 'head', 'options'].includes(method) && op) {
          const opObj = op as OpenAPIV3.OperationObject;
          const generatedToolName = `${method}${path.replace('browser', 'profile').replace(/[^a-zA-Z0-9]/g, '_')}`;
    
          if (generatedToolName === toolName) {
            targetPath = path;
            targetMethod = method.toUpperCase();
            operation = opObj;
            break;
          }
        }
      }
      if (operation) break;
    }
    
    
    if (!operation) {
      throw new Error(`Tool "${toolName}" not found`);
    }
  • src/index.ts:47-71 (registration)
    Registration of tools list handler in setupHandlers(). Dynamically generates tool metadata including name 'delete_workspaces__wid__profiles' from OpenAPI paths using the formula at line 56.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      const tools: Tool[] = [];
      if (this.apiSpec && this.apiSpec.paths) {
        for (const [path, pathItem] of Object.entries(this.apiSpec.paths)) {
          if (!pathItem) continue;
    
          for (const [method, operation] of Object.entries(pathItem)) {
            if (['get', 'post', 'put', 'delete', 'patch', 'head', 'options'].includes(method) && operation) {
              const op = operation as OpenAPIV3.OperationObject;
              const toolName = `${method}${path.replace('browser', 'profile').replace(/[^a-zA-Z0-9]/g, '_')}`;
    
              const inputSchema = this.buildInputSchema(op, path);
    
              tools.push({
                name: toolName,
                description: op.summary || op.description || `${method.toUpperCase()} ${path}`,
                inputSchema,
              });
            }
          }
        }
      }
    
      return { tools };
    });
  • Dynamically constructs the input schema for the tool by extracting path parameters (e.g., 'wid'), query parameters, and request body schema from the corresponding OpenAPI operation.
    private buildInputSchema(operation: OpenAPIV3.OperationObject, path: string): any {
      const properties: any = {};
      const required: string[] = [];
    
      const pathParams = this.extractPathParameters(operation, path);
      const queryParams = this.extractQueryParameters(operation);
      const bodySchema = this.extractRequestBodySchema(operation);
    
      if (pathParams.properties && Object.keys(pathParams.properties).length > 0) {
        for (const [key, prop] of Object.entries(pathParams.properties)) {
          properties[key] = this.convertOpenAPISchemaToJsonSchema(prop as OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject);
          if (pathParams.required.includes(key)) {
            required.push(key);
          }
        }
      }
    
      if (queryParams.properties && Object.keys(queryParams.properties).length > 0) {
        for (const [key, prop] of Object.entries(queryParams.properties)) {
          properties[key] = this.convertOpenAPISchemaToJsonSchema(prop as OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject);
          if (queryParams.required.includes(key)) {
            required.push(key);
          }
        }
      }
    
      if (bodySchema && bodySchema.properties) {
        for (const [key, prop] of Object.entries(bodySchema.properties)) {
          properties[key] = this.convertOpenAPISchemaToJsonSchema(prop as OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject);
          if (bodySchema.required && bodySchema.required.includes(key)) {
            required.push(key);
          }
        }
      }
    
      const schema: any = {
        type: 'object',
        properties,
      };
    
      if (required.length > 0) {
        schema.required = required;
      }
    
      return schema;
    }
  • Helper function to parse tool arguments into API parameters, identifying path parameters such as 'wid' from the path template and args.
    private extractParametersFromArgs(toolName: string, args: Record<string, any>): CallParameters {
      if (!this.apiSpec || !this.apiSpec.paths) {
        return { body: args };
      }
    
      let operation: OpenAPIV3.OperationObject | undefined;
      let path = '';
    
      for (const [apiPath, pathItem] of Object.entries(this.apiSpec.paths)) {
        if (!pathItem) continue;
    
        for (const [method, op] of Object.entries(pathItem)) {
          if (['get', 'post', 'put', 'delete', 'patch', 'head', 'options'].includes(method) && op) {
            const opObj = op as OpenAPIV3.OperationObject;
            const generatedToolName = opObj.operationId || `${method}_${apiPath.replace(/[^a-zA-Z0-9]/g, '_')}`;
    
            if (generatedToolName === toolName) {
              operation = opObj;
              path = apiPath;
              break;
            }
          }
        }
        if (operation) break;
      }
    
      if (!operation) {
        return { body: args };
      }
    
      const pathParams: Record<string, string> = {};
      const queryParams: Record<string, string> = {};
      const bodyParams: any = {};
    
      const pathParamNames = path.match(/\{([^}]+)\}/g)?.map(p => p.slice(1, -1)) || [];
    
      if (operation.parameters) {
        operation.parameters.forEach(param => {
          if ('$ref' in param) return;
    
          const parameter = param as OpenAPIV3.ParameterObject;
          const paramName = parameter.name;
    
          if (parameter.in === 'path' && args[paramName] !== undefined) {
            pathParams[paramName] = String(args[paramName]);
          } else if (parameter.in === 'query' && args[paramName] !== undefined) {
            queryParams[paramName] = String(args[paramName]);
          }
        });
      }
    
      pathParamNames.forEach(paramName => {
        if (args[paramName] !== undefined && !pathParams[paramName]) {
          pathParams[paramName] = String(args[paramName]);
        }
      });
    
      const usedParams = new Set([...Object.keys(pathParams), ...Object.keys(queryParams)]);
      for (const [key, value] of Object.entries(args)) {
        if (!usedParams.has(key)) {
          bodyParams[key] = value;
        }
      }
    
      const parameters: CallParameters = {};
    
      if (Object.keys(pathParams).length > 0) {
        parameters.path = pathParams;
      }
    
      if (Object.keys(queryParams).length > 0) {
        parameters.query = queryParams;
      }
    
      if (Object.keys(bodyParams).length > 0) {
        parameters.body = bodyParams;
      }
    
      return parameters;
    }
  • Loads the remote OpenAPI specification that defines the /workspaces/{wid}/profiles DELETE endpoint used for this tool.
    private async loadApiSpec(): Promise<void> {
      const url = 'https://docs-download.gologin.com/openapi-test.json';
      console.log('url', url);
      const response = await fetch(url);
      if (!response.ok) {
        throw new Error(`HTTP ${response.status}: ${response.statusText}`);
      }
    
      const contentType = response.headers.get('content-type') || '';
      let spec: any;
    
      if (contentType.includes('application/json')) {
        spec = await response.json();
      } else {
        const text = await response.text();
        try {
          spec = JSON.parse(text);
        } catch {
          spec = yaml.load(text);
        }
      }
      // console.log('spec', spec);
      this.apiSpec = spec;
    
      this.baseUrl = this.getBaseUrl(spec);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'Delete' implies a destructive mutation, but the description doesn't disclose whether this is permanent, reversible, requires specific permissions, has rate limits, or what happens to associated data. For a destructive operation with zero annotation coverage, this is a significant gap.

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 appropriately sized for a tool with two parameters and gets straight to the point without unnecessary elaboration.

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?

For a destructive mutation tool with no annotations, 0% schema description coverage, and no output schema, the description is inadequate. It doesn't address critical behavioral aspects (permanence, permissions, side effects) or provide sufficient parameter context. The agent would struggle to use this tool correctly without additional information.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'profiles' and 'workspace' which map to the two parameters (wid, profiles), but provides no additional meaning about what these parameters represent, their format, or constraints. The description doesn't explain that 'wid' is workspace ID or that 'profiles' is an array of profile identifiers.

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 'Delete multiple profiles in workspace' clearly states the action (delete), target resource (profiles), and scope (multiple, in workspace). It distinguishes from sibling 'delete_profile' which appears to delete single profiles, but doesn't explicitly differentiate from other workspace-related delete tools like 'delete_workspaces__wid__members__id_'.

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?

No guidance on when to use this tool versus alternatives. There are multiple sibling delete tools (delete_profile, delete_profile__id__web, delete_workspaces__wid__members__id_) but no indication of when this batch deletion tool is preferred over single deletion tools or other workspace operations.

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

Related 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/gologinapp/gologin-mcp'

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