Skip to main content
Glama

PDF Efforts

Optimize PDF for web (linearize)

optimize_pdf_for_web
Idempotent

Linearize a PDF ("fast web view") so browsers can show page 1 before the whole file has downloaded.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file": "<file>"
    },
    "name": "optimize_pdf_for_web"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesThe PDF.

Output Schema

NameRequiredDescriptionDefault
infoNoFacts about the PDF (get_pdf_info) or the result (e.g. target_met for compress_pdf).
noteNoAnything the user should know about the result.
textNoExtracted text (pdf_to_text, ocr_pdf).
filesYesResult files. Download them before expires_at; pass file_id to another tool to chain.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=true and openWorldHint=true, so the safety profile is covered. The description adds the meaningful behavioral outcome (progressive page rendering), but says nothing about whether the original is preserved, whether file size changes (linearization often increases it — a key tradeoff vs compress_pdf), or how the linearized bytes are returned; with an output schema present that last gap is minor.

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?

A single sentence, front-loaded with the action, with the parenthetical gloss explaining the jargon term. Nothing is wasted or repeated from the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema, full parameter documentation and annotations covering safety, the description only needs to convey purpose and effect, which it does. The remaining omission is the size/quality tradeoff versus compress_pdf, which would help an agent route correctly.

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% and each nested field (url, base64, file_id, filename) is documented in the schema itself, so baseline 3 applies. The description adds no extra meaning about how the file is supplied or any file-type restrictions.

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?

States a specific verb ("Linearize") and resource (PDF), and explains the concrete outcome: browsers can render page 1 before full download. This implicitly separates it from compress_pdf, but it never names a sibling to contrast against.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The stated goal ("fast web view", progressive rendering in browsers) implies the web-publishing use case. However, there is no explicit when-to-use guidance, no mention of when to pick compress_pdf or repair_pdf instead, and no prerequisites or caveats.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources