Skip to main content
Glama
pdfdotco

PDF.co MCP Server

Official
by pdfdotco

create_fillable_forms

Add text fields and checkboxes to PDF documents to create interactive forms for data collection.

Instructions

Create new fillable form elements in a PDF document.

Example annotations format:
[
    {
        "text": "prefilled text",
        "x": 10,
        "y": 30,
        "size": 12,
        "pages": "0-",
        "type": "TextField",
        "id": "textfield1"
    },
    {
        "x": 100,
        "y": 150,
        "size": 12,
        "pages": "0-",
        "type": "Checkbox",
        "id": "checkbox1"
    }
]

Ref: https://developer.pdf.co/api-reference/pdf-add#create-fillable-pdf-forms.md

Input Schema

TableJSON 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.
annotationsYesList of form annotations to create. Each annotation can be a textfield or checkbox with properties like 'x', 'y', 'size', 'pages', 'type', and 'id'.
nameNoFile name for the generated output. (Optional)
httpusernameNoHTTP auth user name if required to access source url. (Optional)
httppasswordNoHTTP auth password if required to access source url. (Optional)
api_keyNoPDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)

Implementation Reference

  • The MCP tool handler function for 'create_fillable_forms', decorated with @mcp.tool. It defines the input schema via Pydantic Fields and implements the logic by preparing parameters and calling the fill_pdf_form_fields service function with annotations.
    @mcp.tool(name="create_fillable_forms")
    async def create_fillable_forms(
        url: str = Field(
            description="URL 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."
        ),
        annotations: list = Field(
            description="List of form annotations to create. Each annotation can be a textfield or checkbox with properties like 'x', 'y', 'size', 'pages', 'type', and 'id'."
        ),
        name: str = Field(
            description="File name for the generated output. (Optional)", default=""
        ),
        httpusername: str = Field(
            description="HTTP auth user name if required to access source url. (Optional)",
            default="",
        ),
        httppassword: str = Field(
            description="HTTP auth password if required to access source url. (Optional)",
            default="",
        ),
        api_key: str = Field(
            description="PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)",
            default="",
        ),
    ) -> BaseResponse:
        """
        Create new fillable form elements in a PDF document.
    
        Example annotations format:
        [
            {
                "text": "prefilled text",
                "x": 10,
                "y": 30,
                "size": 12,
                "pages": "0-",
                "type": "TextField",
                "id": "textfield1"
            },
            {
                "x": 100,
                "y": 150,
                "size": 12,
                "pages": "0-",
                "type": "Checkbox",
                "id": "checkbox1"
            }
        ]
    
        Ref: https://developer.pdf.co/api-reference/pdf-add#create-fillable-pdf-forms.md
        """
        params = ConversionParams(
            url=url,
            httpusername=httpusername,
            httppassword=httppassword,
            name=name,
        )
    
        return await fill_pdf_form_fields(params, annotations=annotations, api_key=api_key)
  • The @mcp.tool decorator registers the 'create_fillable_forms' tool.
    @mcp.tool(name="create_fillable_forms")
  • The function parameters define the input schema using Pydantic Field descriptions for MCP tool validation.
    async def create_fillable_forms(
        url: str = Field(
            description="URL 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."
        ),
        annotations: list = Field(
            description="List of form annotations to create. Each annotation can be a textfield or checkbox with properties like 'x', 'y', 'size', 'pages', 'type', and 'id'."
        ),
        name: str = Field(
            description="File name for the generated output. (Optional)", default=""
        ),
        httpusername: str = Field(
            description="HTTP auth user name if required to access source url. (Optional)",
            default="",
        ),
        httppassword: str = Field(
            description="HTTP auth password if required to access source url. (Optional)",
            default="",
        ),
        api_key: str = Field(
            description="PDF.co API key. If not provided, will use X_API_KEY environment variable. (Optional)",
            default="",
        ),
    ) -> BaseResponse:
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it states this creates form elements and provides an example format, it doesn't describe important behavioral aspects like whether this is a destructive operation, what permissions are required, how errors are handled, or what the output looks like. The example format is helpful but doesn't constitute comprehensive behavioral transparency.

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 description is reasonably concise with three sentences, but the structure could be improved. The first sentence states the purpose, but the second sentence jumps directly to an example format without transitional context. The reference link at the end is useful but could be better integrated. The description is front-loaded with the core purpose but could be more efficiently structured.

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?

For a tool with 6 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what happens after creation, what the output looks like, error conditions, or important behavioral constraints. The example format helps but doesn't compensate for the lack of output information and behavioral context needed for a tool that modifies PDF documents.

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, the baseline is 3 even though the description doesn't add parameter semantics beyond what's in the schema. The description provides an example annotation format that illustrates the 'annotations' parameter structure, but this doesn't significantly enhance understanding beyond the schema's documentation of this parameter.

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 clearly states the action ('Create new fillable form elements') and resource ('in a PDF document'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'pdf_add_annotations_images_fields' or 'fill_forms', which appear related but have different functions.

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. There's no mention of prerequisites, when this tool is appropriate versus other PDF manipulation tools, or any context about the relationship with sibling tools like 'fill_forms' or 'pdf_add_annotations_images_fields'.

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

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/pdfdotco/pdfco-mcp'

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