Skip to main content
Glama

Extend MCP

Detect PDF form fields / generate an edit schema

detect_form_fields

Detect the fillable fields in a PDF form and return an edit schema (edit group): each property is a detected field with its type (text/checkbox/radio/dropdown/signature/table), page index, and bounding box. Use it to see what a form asks for, or as the scaffold for a structured fill — set extend_edit:value on each field and pass the populated schema to edit_pdf. Pass inputSchema to re-run detection against an existing schema (mapping mode) — for the edit-schema rules, call get_documentation with https://docs.extend.ai/editing/configuration.md first. Async: a status: "running" result with a runId is not an error — resume with get_form_detection_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
fileYesThe form PDF. Exactly one of id/url — e.g. { "url": "https://..." } or { "id": "file_..." }, never a bare string.
environmentYes"TEST" = the Test (development) environment, "PRODUCTION" = live. Must match a granted target from get_me (an API key pins one environment).
inputSchemaNoExisting edit schema to map against.
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.
instructionsNoGuidance for schema generation.
advancedOptionsNo{ tableParsingEnabled?, radioEnumsEnabled?, nativeFieldsOnly?, conditionalGenerationEnabled? }

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
runIdYes
outputNoDetected edit schema (PROCESSED only).
statusYesPROCESSING | PROCESSED | FAILED, or "running" (resume via the get tool).
metricsNo
runTypeNo
failureReasonNo
failureMessageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedOutput schema / properties / llmContext
      Removed value: -{
      -  "type": "string"
      -}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond annotations. It discloses the async behavior (status 'running' with runId is not an error, resume with wait:true), the mapping-mode semantics, and the error handling for UNAUTHORIZED/NOT_FOUND. It also points to external documentation for the output shape. No contradiction with annotations; readOnlyHint=false is consistent with the read-like detection operation.

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

Conciseness4/5

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

The description is long but every sentence carries unique information—purpose, usage, async pattern, error handling, and doc links. It is front-loaded with the core purpose, then procedural details. Though dense, it avoids repetition and fluff, earning a high score for efficiency despite its length.

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?

For a complex tool with 7 parameters, nested objects, and an output schema, the description covers all essential aspects: what it returns, how to use it as a scaffold, the mapping mode, async resumption, error recovery, and links to authoritative docs for rules and output format. Nothing critical is missing for an agent to invoke it correctly.

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?

Schema coverage is 100% with per-parameter descriptions. The description adds valuable context beyond the schema: the 'exactly one of id/url, never a bare string' constraint for file, the mapping mode for inputSchema, and the purpose of waitSeconds. AdvancedOptions and instructions are only named, but the schema already covers them. This is a solid improvement over the baseline 3.

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 a specific verb ('Detect'), a concrete resource ('fillable fields in a PDF form'), and the output ('edit schema'). It clearly distinguishes from siblings like edit_pdf (filling) by defining detection as the scaffold. The return structure is explicitly enumerated (field type, page index, bounding box), leaving no ambiguity about what the tool does.

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 when-to-use guidance: 'see what a form asks for' or 'scaffold for a structured fill' with a concrete follow-up (set extend_edit:value and pass to edit_pdf). It also covers the mapping mode (inputSchema) and the async resume pattern with get_form_detection_run, plus error recovery (re-call get_me). This is thorough and actionable.

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