Skip to main content
Glama
PDF.co MCP Server

PDF.co MCP Server

Official
by pdfdotco

Add annotations, images and fields

pdf_add_annotations_images_fields

Add text annotations, images, links, and form-field values to PDFs, including scanned files, to update or fill existing documents.

Instructions

Add text, images, forms, other PDFs, fill forms, links to external sites and external PDF files. You can update or modify PDF and scanned PDF files.

This tool supports three main ways to add content:

  1. annotations: Add text, links, shapes, etc. Properties: text, x, y, size, pages, color, link, fontName, fontItalic, fontBold, fontStrikeout, fontUnderline

  2. images: Add images or other PDF content Properties: url, x, y, width, height, pages

  3. fields: Fill existing form fields Properties: fieldName, pages, text, fontName, size, fontBold, fontItalic, fontStrikeout, fontUnderline

Example annotations: [{"text": "Sample Text - Click here to test link", "x": 250, "y": 240, "size": 24, "pages": "0-", "color": "CCBBAA", "link": "https://pdf.co/", "fontName": "Comic Sans MS", "fontItalic": true, "fontBold": true, "fontStrikeout": false, "fontUnderline": true}]

Example images: [{"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/logo.png", "x": 270, "y": 150, "width": 159, "height": 43, "pages": "0"}]

Example fields: [{"fieldName": "topmostSubform[0].Page1[0].YourSocial_ReadOrderControl[0].f1_05[0]", "pages": "1", "text": "Joan B.", "fontName": "Arial", "size": 6, "fontBold": true, "fontItalic": true, "fontStrikeout": true, "fontUnderline": true}]

Ref: https://developer.pdf.co/api/pdf-add.md

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": {
      "url": "<url>"
    },
    "name": "pdf_add_annotations_images_fields"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesURL to the source PDF file. Supports publicly accessible links including Google Drive, Dropbox, PDF.co Built-In Files Storage. Use 'upload_file' tool to upload local files.
nameNoFile name for the generated output. (Optional)
fieldsNoArray of form field objects to fill PDF form fields. Each object can have: 'fieldName' (string), 'pages' (string), 'text' (string), 'fontName' (string), 'size' (number), 'fontBold' (boolean), 'fontItalic' (boolean), 'fontStrikeout' (boolean), 'fontUnderline' (boolean). (Optional)
imagesNoArray of image objects to add images to PDF. Each object can have: 'url' (string), 'x' (number), 'y' (number), 'width' (number), 'height' (number), 'pages' (string). (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)
encryptNoEncrypt output file. (Optional)
flattenNoFlatten filled form fields and annotations into PDF content. Set to true to disable editing of filled form fields in the output PDF. (Optional)
passwordNoPassword for the PDF file. (Optional)
profilesNoExtra engine options for this endpoint as a JSON object encoded in a string. The options differ per endpoint; see https://developer.pdf.co/api/profiles. (Optional)
expirationNoSet the expiration time for the output link in minutes. After this specified duration, any generated output file(s) will be automatically deleted. (Optional)
annotationsNoArray of annotation objects to add text, links, shapes, etc. Each object can have: 'text' (string), 'x' (number), 'y' (number), 'size' (number), 'pages' (string), 'color' (string hex), 'link' (string URL), 'fontName' (string), 'fontItalic' (boolean), 'fontBold' (boolean), 'fontStrikeout' (boolean), 'fontUnderline' (boolean). (Optional)
httppasswordNoHTTP auth password if required to access source url. (Optional)
httpusernameNoHTTP auth user name if required to access source url. (Optional)

Output Schema

NameRequiredDescriptionDefault
tipsNo
statusYes
contentYes
credits_usedNo
credits_remainingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv0.0.12
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / annotations / title
      Removed value: -"Annotations"
    • removedInput schema / properties / api_key / title
      Removed value: -"Api Key"
    • removedInput schema / properties / encrypt / title
      Removed value: -"Encrypt"
    • removedInput schema / properties / expiration / title
      Removed value: -"Expiration"
    • removedInput schema / properties / fields / title
      Removed value: -"Fields"
    • removedInput schema / properties / flatten / title
      Removed value: -"Flatten"
    • removedInput schema / properties / httppassword / title
      Removed value: -"Httppassword"
    • removedInput schema / properties / httpusername / title
      Removed value: -"Httpusername"
    • removedInput schema / properties / images / title
      Removed value: -"Images"
    • removedInput schema / properties / name / title
      Removed value: -"Name"
    • removedInput schema / properties / password / title
      Removed value: -"Password"
    • removedInput schema / properties / profiles / title
      Removed value: -"Profiles"
    • removedInput schema / properties / url / title
      Removed value: -"Url"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "content": {},
      +    "credits_remaining": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "credits_used": {
      +      "anyOf": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "tips": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null
      +    }
      +  },
      +  "required": [
      +    "status",
      +    "content"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changedv0.0.11
    • addedInput schema / properties / profiles
      Added value: +{
      +  "default": "",
      +  "description": "Extra engine options for this endpoint as a JSON object encoded in a string. The options differ per endpoint; see https://developer.pdf.co/api/profiles. (Optional)",
      +  "title": "Profiles",
      +  "type": "string"
      +}
  3. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, so the safety profile is already known. The description adds that scanned PDFs are supported and that content is added non-destructively, but does not disclose that the result is a generated file delivered via an expiring link, nor how interactions between flatten/encrypt and the added content behave — those facts live only in the schema.

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

Conciseness3/5

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

The definition is front-loaded and logically sectioned into three modes, which helps scanning. But each section first re-lists the property names already documented verbatim in the schema, then repeats them again inside a JSON example, so a meaningful share of the text is duplication rather than added information.

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?

For a 13-parameter mutation tool with an output schema and annotations, the description covers the three payload arrays well enough to construct a valid call, and points to the developer reference for edge cases. Remaining gaps (how the arrays interact when combined, and the 'other PDFs' claim) are modest given the rich schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema coverage at 100%, the baseline is 3, but the three worked examples add genuine meaning beyond the schema: concrete key/value payloads, the 'pages' syntax ('0-' for all, '0', '1'), a bare hex color like 'CCBBAA', and a realistic fully-qualified fieldName path. These are practical details an agent would otherwise have to guess.

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 opening sentence names specific verbs and resources: adding text, images, forms, links, other PDFs and filling form fields. It is clearly distinguishable from conversion siblings like html_to_pdf or merge/split tools. Minor muddiness: 'other PDFs' is advertised but no parameter or example supports overlaying another PDF, and 'update or modify PDF and scanned PDF files' is a broad restatement rather than a precise scope.

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 description structures usage into three modes (annotations, images, fields), which implies when each array should be used. However it never states when to pick this tool over siblings such as create_fillable_forms (for building fields) or pdf_add_password, and gives no prerequisites or exclusions, leaving the routing decision to inference.

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