Skip to main content
Glama
JustasMonkev

MCP Accessibility Scanner

browser_pdf_save

Read-only

Save web pages as PDFs for accessibility compliance checks. Specify a custom filename or use a default timestamp-based name to store the document for further review.

Instructions

Save page as PDF

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameNoFile name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified.

Implementation Reference

  • The handler function for the 'browser_pdf_save' tool. It generates an output filename (defaulting to 'page-{timestamp}.pdf'), adds generated code and result message to the response, and saves the current page as PDF using Playwright's page.pdf() method.
    handle: async (tab, params, response) => {
      const fileName = await tab.context.outputFile(params.filename ?? `page-${new Date().toISOString()}.pdf`);
      response.addCode(`await page.pdf(${javascript.formatObject({ path: fileName })});`);
      response.addResult(`Saved page as ${fileName}`);
      await tab.page.pdf({ path: fileName });
    },
  • Zod schema defining the input parameters for the tool: an optional 'filename' string.
    const pdfSchema = z.object({
      filename: z.string().optional().describe('File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified.'),
    });
  • Tool metadata schema including name, title, description, inputSchema reference, and readOnly type.
    schema: {
      name: 'browser_pdf_save',
      title: 'Save as PDF',
      description: 'Save page as PDF',
      inputSchema: pdfSchema,
      type: 'readOnly',
    },
  • src/tools/pdf.ts:26-47 (registration)
    Defines the 'browser_pdf_save' tool using defineTabTool and exports it as the default array for inclusion in the tools registry.
    const pdf = defineTabTool({
      capability: 'pdf',
    
      schema: {
        name: 'browser_pdf_save',
        title: 'Save as PDF',
        description: 'Save page as PDF',
        inputSchema: pdfSchema,
        type: 'readOnly',
      },
    
      handle: async (tab, params, response) => {
        const fileName = await tab.context.outputFile(params.filename ?? `page-${new Date().toISOString()}.pdf`);
        response.addCode(`await page.pdf(${javascript.formatObject({ path: fileName })});`);
        response.addResult(`Saved page as ${fileName}`);
        await tab.page.pdf({ path: fileName });
      },
    });
    
    export default [
      pdf,
    ];
  • src/tools.ts:50-50 (registration)
    Includes the pdf tools (including 'browser_pdf_save') in the allTools array that is used by the backend for listTools().
    ...pdf,
Behavior3/5

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

Annotations provide readOnlyHint=true, destructiveHint=false, and openWorldHint=true, indicating a safe, non-destructive operation with flexible inputs. The description adds minimal behavioral context beyond this—it implies saving the current page but doesn't specify what 'page' means (e.g., current tab, entire page vs. viewport) or any limitations (e.g., file size, format constraints). No contradiction with annotations exists, but the description under-leverages the opportunity to clarify behavior.

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, front-loading the core action without unnecessary elaboration. Every word ('Save', 'page', 'PDF') directly contributes to understanding the tool's function, making it efficient and easy to parse.

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 lack of output schema and the tool's potential complexity (saving a PDF involves rendering and file I/O), the description is insufficient. It doesn't address what happens on success/failure, where the PDF is saved, or any dependencies (e.g., requires a loaded page). With annotations covering safety but not operational details, more context is needed for reliable use.

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?

With 100% schema description coverage for the single parameter 'filename', the schema fully documents its purpose and default behavior. The description adds no parameter-specific information beyond the tool's overall function, so it meets the baseline of 3 where the schema handles the heavy lifting without extra value from the description.

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

Purpose4/5

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

The description 'Save page as PDF' clearly states the verb ('Save') and resource ('page as PDF'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'browser_take_screenshot' or 'browser_snapshot' that might also capture page content, leaving room for confusion about when to choose this specific PDF-saving function.

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. It doesn't mention prerequisites (e.g., requires an active browser page), exclusions (e.g., can't save dynamic content), or comparisons to siblings like 'browser_take_screenshot' for image capture or 'browser_snapshot' for other formats. This lack of context could lead to inappropriate tool 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/JustasMonkev/mcp-accessibility-scanner'

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