Skip to main content
Glama

Extend MCP

Fill a PDF form

edit_pdf

Fill form fields in a PDF and return the edited file (edit group). Values come from instructions (free-form prose, e.g. "name is Acme Corp; date is 2026-04-15") and/or schema (an edit schema from detect_form_fields with extend_edit:value set per field; extend_edit:image with an image_url for signature images). The document passed here must be the TARGET form, not the source you read values from — parse or extract the source first, then fill. Before authoring a schema fill by hand, call get_documentation with https://docs.extend.ai/editing/configuration.md and follow it. templateId runs a saved edit template instead of file; its stored schema/instructions apply unless overridden below. Output is a pointer { id, presignedUrl } to the filled PDF; the URL expires in ~15 minutes (re-fetch with get_file). Async: a status: "running" result with a runId is not an error — resume with get_edit_run passing that runId, the same workspaceId and environment, and wait: true, repeating until the status is terminal; never re-submit the document. On UNAUTHORIZED or NOT_FOUND, re-call get_me for the granted targets. Output shape is documented at https://docs.extend.ai/editing/response-format.md (get_documentation).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoThe PDF form to fill. Exactly one of id/url — e.g. { "url": "https://..." } or { "id": "file_..." }, never a bare string.
schemaNoPopulated edit schema (root type: "object", fields carrying extend_edit:* keys). Generate with detect_form_fields.
templateIdNoID of a saved edit template to use instead of file; instructions/schema/advancedOptions below override the template's values when provided.
environmentYes"TEST" = the Test (development) environment, "PRODUCTION" = live. Must match a granted target from get_me (an API key pins one environment).
waitSecondsNoMax seconds to block waiting on the run (clamped to the server wait budget).
workspaceIdYesTarget workspace (ws_...). Must be a granted workspace — get_me lists the accepted values.
instructionsNoProse fill values and/or formatting guidance.
advancedOptionsNo{ flattenPdf?, preserveSignatureValidity?, tableParsingEnabled?, radioEnumsEnabled?, nativeFieldsOnly?, conditionalGenerationEnabled? }. preserveSignatureValidity defaults to false. When enabled on signed or append-only PDFs, fills existing compatible fields using extend_edit:source_acroform.fieldName or matching schema field names. Missing text, choice, checkbox, and table fields are skipped. New signatures may still be added where permitted. Defaults flattenPdf to false; flattening signed or append-only PDFs is not supported in this mode. Requires Edit engine 1.0.0-beta or later.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
runIdYes
outputNoPointer to the filled PDF (PROCESSED only); the presignedUrl expires in ~15 minutes.
statusYesPROCESSING | PROCESSED | FAILED, or "running" (resume via the get tool).
metricsNo
runTypeNo
failureReasonNo
failureMessageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / templateId
      Added value: +{
      +  "description": "ID of a saved edit template to use instead of file; instructions/schema/advancedOptions below override the template's values when provided.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "workspaceId",
      -  "environment",
      -  "file"
      -]New value: +[
      +  "workspaceId",
      +  "environment"
      +]
  2. Changed1 schema field changed
    • removedOutput schema / properties / llmContext
      Removed value: -{
      -  "type": "string"
      -}
  3. Changed1 schema field changed
    • changedInput schema / properties / advancedOptions / description
      Previous value: -"{ flattenPdf?, tableParsingEnabled?, radioEnumsEnabled?, nativeFieldsOnly?, conditionalGenerationEnabled? }"New value: +"{ flattenPdf?, preserveSignatureValidity?, tableParsingEnabled?, radioEnumsEnabled?, nativeFieldsOnly?, conditionalGenerationEnabled? }. preserveSignatureValidity defaults to false. When enabled on signed or append-only PDFs, fills existing compatible fields using extend_edit:source_acroform.fieldName or matching schema field names. Missing text, choice, checkbox, and table fields are skipped. New signatures may still be added where permitted. Defaults flattenPdf to false; flattening signed or append-only PDFs is not supported in this mode. Requires Edit engine 1.0.0-beta or later."
  4. First observed

TDQS

A5/5.0
Behavior5/5

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

The description discloses async behavior (running status, resume with get_edit_run), output URL expiry (~15 minutes, re-fetch with get_file), template override semantics, advancedOptions defaults (preserveSignatureValidity false), and error handling. It adds substantial context beyond annotations (readOnlyHint false, etc.) without any contradiction. Fully aware of mutation nature and idempotency implications.

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?

Though long, every sentence earns its place—covering input requirements, async flow, error handling, and advanced options. The text is organized logically, front-loading the core purpose and then addressing usage, async, and edge cases. No redundancy or filler; easily scannable by an agent.

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

Completeness5/5

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

Given 8 parameters, nested objects, async behavior, and template support, the description covers every aspect needed for correct use: inputs, async polling, error recovery, output pointer structure, template override, and advanced options. It even directs to external documentation for response format, which is acceptable since an output schema exists. Nothing essential is missing.

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

Parameters5/5

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

Schema description coverage is 100%, so baseline is 3, but the description adds critical meaning: file must be exactly one of id/url (never bare string), schema originates from detect_form_fields, waitSeconds is clamped, advancedOptions details (flattening, signature validity), and templateId override behavior. These constraints are not obvious from the schema alone and are essential for correct invocation.

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

Purpose5/5

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

States the specific verb 'fill' with resource 'PDF form fields' and output 'edited file'. Clearly distinguishes from sibling tools like detect_form_fields (schema generation) and get_edit_run (async polling) by explaining inputs and flow. The purpose is unambiguous and directly usable by an agent.

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

Usage Guidelines5/5

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

Provides explicit usage context: the target must be the form, not the source; parse/extract first; when to call get_documentation before hand-authoring a schema; templateId alternative; and error recovery via get_me. Names alternatives (detect_form_fields, get_edit_run) and gives conditions for their use. Nothing is left to inference.

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