Skip to main content
Glama

pilot_pdf

Convert web pages to PDF files for saving or sharing content. Specify an output path to generate PDFs from browser automation.

Instructions

Save the current page as a PDF.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_pathNoOutput file path

Implementation Reference

  • Registration and implementation of the 'pilot_pdf' tool.
    server.tool(
      'pilot_pdf',
      'Save the current page as a PDF.',
      { output_path: z.string().optional().describe('Output file path') },
      async ({ output_path }) => {
        await bm.ensureBrowser();
        try {
          const pdfPath = output_path || path.join(TEMP_DIR, 'pilot-page.pdf');
          await bm.getPage().pdf({ path: pdfPath, format: 'A4' });
          return { content: [{ type: 'text' as const, text: `PDF saved: ${pdfPath}` }] };
        } 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