Skip to main content
Glama
gologinapp

GoLogin MCP

Official
by gologinapp

get_profile__id_

Retrieve specific browser profile details using a unique ID to manage and configure settings within the GoLogin automation platform.

Instructions

Get profile by id

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
currentWorkspaceNo
idYes

Implementation Reference

  • src/index.ts:47-71 (registration)
    Dynamic registration of tools, including 'get_profile__id_', generated from OpenAPI spec paths by replacing 'browser' with 'profile' and sanitizing path to create tool names.
    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 };
    });
  • The core handler function that implements all dynamic tools like 'get_profile__id_' by parsing the tool name back to the corresponding OpenAPI path/method, constructing the URL, and making the HTTP request to the GoLogin API.
    private async callDynamicTool(
      toolName: string,
      parameters: CallParameters = {},
      headers: Record<string, string> = {}
    ): Promise<CallToolResult> {
      console.log('parameters', parameters.body);
      if (!this.apiSpec || !this.apiSpec.paths) {
        throw new Error('API specification not loaded');
      }
    
      let targetPath = '';
      let targetMethod = '';
      let operation: OpenAPIV3.OperationObject | undefined;
    
      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`);
      }
    
      let url = `${this.baseUrl}${targetPath}`;
      const requestHeaders: Record<string, string> = { ...headers };
      let requestBody: string | undefined;
    
      requestHeaders['User-Agent'] = 'gologin-mcp';
      console.error('this.token', this.token);
      if (this.token) {
        requestHeaders['Authorization'] = `Bearer ${this.token}`;
      }
    
      if (parameters.path) {
        for (const [key, value] of Object.entries(parameters.path)) {
          url = url.replace(`{${key}}`, encodeURIComponent(value));
        }
      }
    
      const queryParams = new URLSearchParams();
      if (parameters.query) {
        for (const [key, value] of Object.entries(parameters.query)) {
          if (value) {
            queryParams.append(key, value);
          }
        }
      }
    
      if (queryParams.toString()) {
        url += `?${queryParams.toString()}`;
      }
      if (parameters.body && ['POST', 'PUT', 'PATCH', 'DELETE'].includes(targetMethod)) {
        requestHeaders['Content-Type'] = 'application/json';
        requestBody = JSON.stringify(parameters.body);
      }
      console.log('requestBody', requestBody);
      try {
        const fetchOptions: RequestInit = {
          method: targetMethod,
          headers: requestHeaders,
        };
        console.error('fetchOptions', fetchOptions);
        if (requestBody) {
          fetchOptions.body = requestBody;
        }
        const response = await fetch(url, fetchOptions);
    
        const responseHeaders: Record<string, string> = {};
        response.headers.forEach((value, key) => {
          responseHeaders[key] = value;
        });
    
        let responseBody: any;
        const contentType = response.headers.get('content-type') || '';
    
    
        if (contentType.includes('application/json')) {
          try {
            responseBody = await response.json();
          } catch {
            responseBody = await response.text();
          }
        } else {
          responseBody = await response.text();
        }
        return {
          content: [
            {
              type: 'text',
              text: `API Call Result:\n` +
                `URL: ${url}\n` +
                `Method: ${targetMethod}\n` +
                `Status: ${response.status} ${response.statusText}\n\n` +
                `Response Headers:\n${JSON.stringify(responseHeaders, null, 2)}\n\n` +
                `Response Body:\n${typeof responseBody === 'object' ? JSON.stringify(responseBody, null, 2) : responseBody}`,
            },
          ],
        };
      } catch (error) {
        throw new Error(`API call failed: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • MCP CallTool request handler that dispatches to dynamic tool execution for tools like 'get_profile__id_'.
    this.server.setRequestHandler(CallToolRequestSchema, async (request: any): Promise<CallToolResult> => {
      const { name, arguments: args } = request.params;
    
      if (!args) {
        throw new Error('No arguments provided');
      }
      console.log('args', args);
      try {
        const parameters: CallParameters = this.extractParametersFromArgs(name, args);
        return await this.callDynamicTool(name, parameters, args.headers as Record<string, string> | undefined);
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    });
  • Dynamically generates input schema for tools like 'get_profile__id_' based on OpenAPI operation parameters.
    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;
    }
  • Name generation logic used to create tool names such as 'get_profile__id_' from API paths.
              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 };
    });
    
    this.server.setRequestHandler(CallToolRequestSchema, async (request: any): Promise<CallToolResult> => {
      const { name, arguments: args } = request.params;
    
      if (!args) {
        throw new Error('No arguments provided');
      }
      console.log('args', args);
      try {
        const parameters: CallParameters = this.extractParametersFromArgs(name, args);
        return await this.callDynamicTool(name, parameters, args.headers as Record<string, string> | undefined);
      } catch (error) {
        return {
          content: [
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get profile by id' only indicates a read operation without detailing authentication needs, rate limits, error handling, or what the return format looks like (e.g., JSON structure). For a tool with no annotation coverage, this leaves critical behavioral traits unspecified, making it inadequate for safe and effective use.

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 extremely concise at three words, with no wasted language. It is front-loaded and to the point, though this brevity contributes to its inadequacy in other dimensions. Every word earns its place by directly stating the tool's action, but it lacks necessary elaboration for a complete tool definition.

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

Completeness1/5

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

Given the tool's complexity (a read operation with parameters), no annotations, no output schema, and low schema coverage, the description is incomplete. It does not provide enough context for an AI agent to understand how to invoke the tool correctly, what to expect in return, or how it fits among siblings. The minimal information fails to meet the needs for effective tool usage.

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

Parameters1/5

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

The input schema has 2 parameters with 0% description coverage, meaning neither 'currentWorkspace' nor 'id' are documented in the schema. The description adds no parameter semantics beyond implying an 'id' is needed, failing to explain what 'currentWorkspace' does, the format of 'id', or any constraints. With low schema coverage, the description does not compensate, leaving parameters largely unexplained.

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

Purpose2/5

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

The description 'Get profile by id' is essentially a tautology that restates the tool name 'get_profile__id_' with minimal elaboration. It specifies the verb 'Get' and resource 'profile', but lacks any distinguishing details about what a 'profile' entails or how this differs from sibling tools like 'get_profile_v2' or 'get_profile_fingerprint'. The purpose is stated but remains vague without context.

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

Usage Guidelines1/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. With multiple sibling tools like 'get_profile_v2', 'get_profile_fingerprint', and 'get_profile__id__cookies', there is no indication of when this specific 'get_profile__id_' is appropriate, what prerequisites exist, or any exclusions. Usage is implied solely by the name, offering no practical help for selection.

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