Skip to main content
Glama

export_page

Export webpages with all embedded resources for offline use or archiving. This tool captures complete page content including images, stylesheets, and scripts from any URL.

Instructions

Export webpage with resources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
headersNo
bestAttemptNo

Implementation Reference

  • Core handler implementation for the 'export_page' tool. Makes a POST request to Browserless /export endpoint with ExportRequest and returns ExportResponse.
    async exportPage(request: ExportRequest): Promise<BrowserlessResponse<ExportResponse>> {
      try {
        const response: AxiosResponse<ExportResponse> = await this.httpClient.post('/export', request);
    
        return {
          success: true,
          data: response.data,
        };
      } catch (error) {
        return this.handleError(error);
      }
    }
  • src/index.ts:159-171 (registration)
    Tool registration in MCP ListTools response, defining name, description, and input schema for 'export_page'.
    {
      name: 'export_page',
      description: 'Export webpage with resources',
      inputSchema: {
        type: 'object',
        properties: {
          url: { type: 'string' },
          headers: { type: 'object' },
          bestAttempt: { type: 'boolean' },
        },
        required: ['url'],
      },
    },
  • MCP CallTool handler that invokes BrowserlessClient.exportPage and formats the response.
    case 'export_page': {
      if (!args) throw new Error('Arguments are required');
      const result = await this.client!.exportPage(args as any);
      if (result.success && result.data) {
        return {
          content: [
            {
              type: 'text',
              text: `Page exported successfully with ${result.data.resources.length} resources.`,
            },
            {
              type: 'text',
              text: result.data.html,
            },
          ],
        };
      } else {
        throw new Error(result.error || 'Failed to export page');
      }
    }
  • Detailed Zod schema validation for ExportRequest input type.
    export const ExportRequestSchema = z.object({
      url: z.string(),
      headers: z.record(z.string()).optional(),
      gotoOptions: z.object({
        waitUntil: z.string().optional(),
        timeout: z.number().optional(),
      }).optional(),
      waitForSelector: WaitForSelectorSchema.optional(),
      waitForTimeout: z.number().optional(),
      bestAttempt: z.boolean().optional(),
    });
    
    export type ExportRequest = z.infer<typeof ExportRequestSchema>;
  • TypeScript interface for ExportResponse output type.
    export interface ExportResponse {
      html: string;
      resources: Array<{
        url: string;
        data: Buffer;
        type: string;
      }>;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions exporting 'with resources', which hints at including assets like images or scripts, but doesn't specify output format, whether it's a file or data, error handling, or performance implications. This leaves significant gaps for a tool that likely performs network operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise with just one phrase, which is appropriately sized for a simple concept. However, it's too brief to be fully informative, bordering on under-specification rather than efficient communication.

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 no annotations, 3 parameters with 0% schema coverage, no output schema, and complexity from network operations, the description is incomplete. It doesn't cover what gets exported, in what format, error conditions, or how parameters interact, making it insufficient for reliable tool invocation.

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 but adds no parameter information. It doesn't explain what 'url', 'headers', or 'bestAttempt' mean, their formats, or how they affect the export. For 3 parameters with no schema descriptions, this is inadequate.

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 'Export webpage with resources' states a general purpose (exporting webpages) but lacks specificity about what 'with resources' means or how it differs from sibling tools like 'take_screenshot' or 'generate_pdf'. It uses a clear verb ('Export') and resource ('webpage'), but doesn't distinguish from alternatives.

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 is provided on when to use this tool versus alternatives like 'take_screenshot', 'generate_pdf', or 'get_content'. The description doesn't mention any prerequisites, constraints, or typical use cases, leaving the agent with no contextual usage information.

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

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/Lizzard-Solutions/browserless-mcp'

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