Skip to main content
Glama

JustFill PDF Form Automation

Bulk-delete matching fields

prune_fields
Destructive

Bulk-delete fields matching ALL given criteria (detection noise) in the active workspace.

Filter & guardrail semantics: permanently deletes every field in `workspace_id`
that satisfies **all** non-`None` filter criteria (`field_type`,
`confidence_below`, `width_below`, `height_below`, `page_index`). At least one
criterion **must** be provided — omitting all five criteria (`None`) is
rejected with `{"error": ...}` to prevent accidentally deleting all fields.
Thresholds (`confidence_below`, `width_below`, `height_below`) are
strictly-less-than (`<`); `width_below` and `height_below` are in `%` of page
width/height (`0.0`–`100.0`). Pass `exclude_ids` as a guardrail allowlist of
`field_id`s that must be preserved even when they match the criteria. Returns
`{"removed": <count>, "removed_ids": [...], "fields_remaining": <count>}` so
deletions are auditable (and reversible via `add_field`). Does not affect
saved templates unless `save_template` is called.

When to use:
- Use `prune_fields` for rule-based bulk cleanup of detection noise (e.g.
  tiny table cells or low-confidence boxes).
- Use `remove_fields` to delete an explicit list of known `field_id`s, or
  `remove_field` to delete a single field by ID.

Input Schema

NameRequiredDescriptionDefault
field_typeNoExact field type to match for deletion (e.g. `'cell'`, `'field'`, `'text'`, `'checkbox'`). Omit or pass `None` to match any type.
page_indexNo0-based page index (`0` to `page_count - 1`) to restrict pruning to a single page. Omit or pass `None` to prune matching fields across all pages.
exclude_idsNoOptional guardrail allowlist of `field_id`s to protect and keep in the workspace even if they match all pruning criteria.
width_belowNoStrictly-less-than width threshold as a percentage of page width (`0.0`–`100.0`); only fields with `w < width_below` match. Omit or pass `None` for no width filter.
height_belowNoStrictly-less-than height threshold as a percentage of page height (`0.0`–`100.0`); only fields with `h < height_below` match. Omit or pass `None` for no height filter.
workspace_idYesActive workspace ID returned by `open_pdf` (`summary.workspace_id`).
confidence_belowNoStrictly-less-than ML confidence threshold (`0.0`–`1.0`); only fields with `confidence < confidence_below` match. Omit or pass `None` for no confidence filter.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / confidence_below / description
      Added value: +"Strictly-less-than ML confidence threshold (`0.0`–`1.0`); only fields with `confidence < confidence_below` match. Omit or pass `None` for no confidence filter."
    • addedInput schema / properties / exclude_ids / description
      Added value: +"Optional guardrail allowlist of `field_id`s to protect and keep in the workspace even if they match all pruning criteria."
    • addedInput schema / properties / field_type / description
      Added value: +"Exact field type to match for deletion (e.g. `'cell'`, `'field'`, `'text'`, `'checkbox'`). Omit or pass `None` to match any type."
    • addedInput schema / properties / height_below / description
      Added value: +"Strictly-less-than height threshold as a percentage of page height (`0.0`–`100.0`); only fields with `h < height_below` match. Omit or pass `None` for no height filter."
    • addedInput schema / properties / page_index / description
      Added value: +"0-based page index (`0` to `page_count - 1`) to restrict pruning to a single page. Omit or pass `None` to prune matching fields across all pages."
    • addedInput schema / properties / width_below / description
      Added value: +"Strictly-less-than width threshold as a percentage of page width (`0.0`–`100.0`); only fields with `w < width_below` match. Omit or pass `None` for no width filter."
    • addedInput schema / properties / workspace_id / description
      Added value: +"Active workspace ID returned by `open_pdf` (`summary.workspace_id`)."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description goes well beyond that: it explains the all-None rejection guard, the AND-semantics of criteria, strictly-less-than thresholds, the exclude_ids allowlist as a safety mechanism, the exact return payload for auditability, reversibility via add_field, and that saved templates are untouched unless save_template is called. That is exactly the extra context the annotation bar asks for.

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?

Front-loaded with the destructive action and the guardrail, then structured into a semantics block and a 'When to use' block. Some threshold-range phrasing repeats the schema, so it is a touch longer than strictly needed, but nearly every sentence carries decision-relevant information.

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 7-parameter destructive bulk operation, the description covers the dangerous edge case (empty criteria), safety valves (exclude_ids), matching semantics, side effects on templates, and even the return shape despite an output schema existing. Nothing an agent needs before invoking it destructively is missing.

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% and already documents each parameter's units and ranges, so the baseline is 3. The description adds value the schema does not: that criteria are conjunctive (ALL non-None filters must match), that at least one must be supplied, and how exclude_ids overrides matching. Marginal duplication of the percent/threshold semantics keeps it at 4 rather than 5.

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?

The first line states a specific verb+resource+scope: bulk-delete fields matching ALL criteria in the active workspace, framed as detection-noise cleanup. It is immediately distinguishable from remove_fields/remove_field, which the description names explicitly.

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?

A dedicated 'When to use' block names both alternatives (remove_fields for explicit ID lists, remove_field for a single ID) and the condition that selects each. It also flags the scenario class (tiny table cells, low-confidence boxes) where this tool is the right choice.

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.