Affinda MCP

Extract and validate data from documents and manage Affinda workspaces, document types, fields and integrations through Affinda's hosted MCP server.

Tools

This is a reference catalogue. Tools cannot be configured or run from this page.

  • Update organization

    Rename an organization. Use this only when the user explicitly asks to rename their organization (e.g. company rebrand, fixing a typo from signup). The name shown across the Affinda UI updates accordingly. The caller must have admin or owner rights on the organization; otherwise the API rejects the update. This tool only changes the display name. There are no per-organization processing settings — workspace-level configuration belongs on the workspace, so for OCR / splitting / classification changes use ``update_workspace`` instead. Args: ctx: MCP context (injected by FastMCP). organization_id: ID of the organization to rename. name: New display name.

  • Update tag

    Rename a tag. Use this when the user wants to change a tag's name — e.g. "rename the Urgent tag to High Priority". The rename applies everywhere at once: every document carrying the tag shows the new name immediately. A tag cannot be moved to a different workspace; create a new tag there instead. To change which documents carry the tag, use ``add_tag_to_documents`` / ``remove_tag_from_documents``. Args: ctx: MCP context (injected by FastMCP). tag_id: ID of the tag to rename. name: New tag name. Max 256 chars.

  • Update validation rule

    Update one or more settings on an existing validation rule. Use this when the user asks to MODIFY a rule (change its prompt, enable/disable it, change the field set). When the user wants to extend an existing rule's logic, read the current ``prompt`` via ``get_validation_rule`` first and merge the new requirement into a single combined prompt — do NOT create a parallel rule. Only the parameters you provide are sent; omitted parameters are untouched. For brand-new checks not already covered by an existing rule, use ``create_validation_rule``. To remove a rule, use ``delete_validation_rule``. To re-run validation against a document after changes, use ``create_validation_run``. Always reference fields in ``prompt`` via the ``@<field_id>`` syntax, not plain text — call ``list_fields`` for IDs. **For data inside a table or group, reference the CHILD (cell) field IDs, NOT the parent field ID.** Parent fields (``field_type`` in ``{table, table_deprecated, group}`` with a non-empty ``children`` list) are the row / container; only children hold actual cell values. A rule against the parent ID validates the container, not the data. For a ``lineItems`` table (id=4820) with cell children ``quantity`` (4822), ``unitPrice`` (4823), ``amount`` (4824): - ✅ ``prompt="@4822 must be > 0"`` and ``field_ids=["4822"]`` - ❌ ``prompt="@4820 must not be empty"`` and ``field_ids=["4820"]`` Same applies to ``group`` parents. Translate row-level user phrasing ("each line item must…", "every row's…") into references on the cell children, never the parent. Args: ctx: MCP context (injected by FastMCP). validation_rule_id: ID of the rule to update. prompt: New natural-language rule, with ``@<field_id>`` references. field_ids: New list of fields the rule validates. Pass as a native list, not a JSON string. enabled: Toggle the rule on/off. generate_code: Force regeneration of the validation code from the prompt. Default ``False``.

  • Update workspace

    Update one or more settings on an existing workspace. Use this for any settings change after creation: renaming, toggling OCR mode, enabling/disabling splitting or classification, switching model-memory strategy, or flipping validation flags. Only the parameters you provide are sent to the API; omitted parameters are untouched. Always read the current state with ``get_workspace_details`` first if you need to reason about deltas. Enabling splitting in an update requires the same setup as creation: pass ``enable_document_splitting=True`` together with a ``document_splitter_id``. Disabling splitting only needs ``enable_document_splitting=False``. For the initial create, use ``create_workspace`` (or ``create_recruit_workspace`` for the resume bundle). To change which document types are assigned to a workspace, use ``assign_document_type_to_workspace`` — that's a relationship operation, not a workspace setting. Args: ctx: MCP context (injected by FastMCP). workspace_id: Internal numeric ID returned by list_workspaces, not the alphabetic identifier. name: New display name. Max 40 chars. visibility: ``organization`` or ``private``. ocr_mode: ``auto-detect``, ``always-full``, ``always-partial``, ``skip``. See ``create_workspace`` for semantics. enable_document_splitting: Toggle splitting. document_splitter_id: Required when enabling splitting; ignored otherwise. enable_document_classification: Toggle classification. reject_duplicates: Toggle duplicate rejection. model_memory_strategy: ``auto``, ``manual``, ``always``. enable_validation: Toggle validation rules. auto_validation: Toggle auto-validation after extraction. Only meaningful when ``enable_validation`` is ``True``.

  • Wait for document processing

    Block until every document in a workspace has finished processing. Use this after uploading documents — it polls internally until OCR, splitting, and classification are complete, then returns the final list (including any children created by splitting). Saves the caller from looping ``list_documents`` themselves. Prefer this over manual polling with ``list_documents``; manual loops waste turns and can race against in-flight splitting. For one-off state checks once processing has settled, use ``list_documents`` or ``get_document``. Args: ctx: MCP context (injected by FastMCP). workspace_id: Workspace to monitor. timeout_seconds: Cap on total wait. Default 120, hard-capped at 300. On timeout, returns ``timed_out=True`` with the current state — callers can re-invoke to keep waiting.

PreviousPage 5 / 5