Skip to main content
Glama

pilot_set_header

Configure custom HTTP headers for web requests, with sensitive values automatically redacted in responses to maintain security.

Instructions

Set a custom request header. Sensitive values are auto-redacted in the response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesHeader name
valueYesHeader value

Implementation Reference

  • The 'pilot_set_header' tool is registered and implemented within 'registerSettingsTools'. It sets a custom header on the browser context via 'bm.setExtraHeader' and includes basic redaction for sensitive headers in the response.
    server.tool(
      'pilot_set_header',
      'Set a custom request header. Sensitive values are auto-redacted in the response.',
      {
        name: z.string().describe('Header name'),
        value: z.string().describe('Header value'),
      },
      async ({ name, value }) => {
        await bm.ensureBrowser();
        try {
          await bm.setExtraHeader(name, value);
          const sensitiveHeaders = ['authorization', 'cookie', 'set-cookie', 'x-api-key', 'x-auth-token'];
          const redactedValue = sensitiveHeaders.includes(name.toLowerCase()) ? '****' : value;
          return { content: [{ type: 'text' as const, text: `Header set: ${name}: ${redactedValue}` }] };
        } catch (err) {
          return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
        }
      }
    );

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/TacosyHorchata/Pilot'

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