Skip to main content
Glama
gologinapp

GoLogin MCP

Official
by gologinapp

put_proxy__id_

Update proxy settings by specifying the ID, mode (e.g., http, socks5), host, port, and authentication details. Manage IP changes, custom names, and notes for efficient proxy configuration in GoLogin MCP.

Instructions

Update proxy

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
changeIpUrlNoThis allows you to change IP address of the proxy if your proxy provider supports it.
customNameNoAs proxy is separate entity in gologin, you can set custom name for it to identify it in the list of proxies.
hostNoProxy host. It could be ip address or domain name.
idYesYou can specify particular proxy by its id or leave it empty to use default proxy.
modeYesProxy mode represent the protocolo of the connection to the proxy.
notesNoParameter for proxy management.
passwordNoProxy password if proxy requires authentication.
portNoProxy port.
usernameNoProxy username.

Implementation Reference

  • src/index.ts:47-71 (registration)
    Dynamic tool registration: iterates over OpenAPI paths, constructs toolName like 'put_proxy__id_' for path '/proxy/{id}' and method 'put', and registers the tool with inputSchema.
    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 shared handler for all dynamic tools. Matches 'put_proxy__id_' to PUT /proxy/{id}, extracts id as path param, sends PUT request to GoLogin API with optional query/body/headers, returns response details.
    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)}`);
      }
    }
  • Builds the inputSchema for the tool from OpenAPI operation parameters (path: id, query, body), used during registration.
    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 to parse tool call arguments into HTTP parameters (path/query/body) by matching toolName to OpenAPI operation.
    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;
    }
Behavior2/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. 'Update proxy' implies a mutation operation, but the description doesn't specify whether this requires authentication, what permissions are needed, whether changes are reversible, or what happens on success/failure. It also doesn't mention rate limits, side effects, or response format. For a mutation tool with zero annotation coverage, this is a significant gap in behavioral context.

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 just two words ('Update proxy'), which is front-loaded and wastes no space. For a tool with comprehensive schema documentation, this brevity is appropriate as it avoids redundancy. Every word earns its place by stating the core function 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?

Given the complexity (9 parameters, mutation operation) and lack of annotations or output schema, the description is incomplete. It doesn't address key contextual aspects like what 'update' entails (partial vs. full updates), how it interacts with sibling tools, or what the agent should expect upon invocation. For a tool with no output schema and no annotations, the description should provide more guidance on behavior and outcomes.

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?

Schema description coverage is 100%, meaning all 9 parameters are well-documented in the input schema itself. The description adds no additional parameter information beyond what's already in the schema (e.g., no examples, no clarification of relationships between parameters). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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

Purpose3/5

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

The description 'Update proxy' clearly states the action (update) and resource (proxy), but it's vague about what specifically gets updated. It doesn't differentiate from sibling tools like 'patch_profile_proxy_many_v2' or 'post_proxy_add_proxies' which might also modify proxy configurations. The description lacks specificity about scope or target.

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. With multiple sibling tools that manipulate proxies (e.g., 'delete_proxy__id_', 'post_proxy_add_proxies', 'patch_profile_proxy_many_v2'), there's no indication of when this particular update operation is appropriate versus creation, deletion, or batch updates. No prerequisites or context for usage are mentioned.

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