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.

  • List integration connections

    List third-party service connections in an organization. Use this before writing integration code to discover which services are already authenticated (Slack, Google Sheets, Salesforce, etc.). Each connection carries an ``account_id`` you reference inside Lambda code and an ``id`` you pass to ``add_connection_to_integration`` when attaching the connection to an integration. If no connection exists for the service the user needs, search available providers with ``list_pipedream_apps`` and start an OAuth flow with ``create_connect_token``. Args: ctx: MCP context (injected by FastMCP). organization_id: Organization to list connections for.

  • List integration runs

    List recent runs for an integration, newest first. Use this to scan run history — for example, after ``run_integration`` to confirm the test landed, or when a user reports problems and you need to spot which runs failed. Each item includes success status, triggering document, and a log snippet. Logs in this list are truncated to 10,000 characters. For diagnosing a specific failure, identify the run ID here and call ``get_integration_run`` to fetch full untruncated logs. Args: ctx: MCP context (injected by FastMCP). integration_id: Integration to list runs for. limit: Cap on returned items. Default 5.

  • List integrations

    List integrations in an organization. Use this to discover existing integrations — for example, to find an ``integration_id`` to pass into other tools, or to show the user what is already configured. Each item includes name, trigger event, and enabled / deployed status. Returns a lean view: Python source code is omitted. To read the code or attached connections, call ``get_integration`` on a specific item. Args: ctx: MCP context (injected by FastMCP). organization_id: Organization to list integrations for. Required. workspace_id: Optional — restrict to integrations scoped to one workspace. enabled: Optional — ``True`` for enabled-only, ``False`` for disabled-only, omit for both. limit: Cap on returned items. Default 20.

  • List integration secrets

    List the names of secrets configured for an integration. Use this when an integration needs an API key, token, or other credential to talk to an external service that is NOT being accessed via a Pipedream connection (Pipedream connections handle their own auth via ``account_id``). Call this before writing integration code to discover what credentials are already available — secret names map directly to environment variables accessible inside the Lambda as ``os.environ["SECRET_NAME"]``. Returns names only. The secret values themselves live as Lambda environment variables and are not readable through any tool. Args: ctx: MCP context (injected by FastMCP). integration_id: Integration to list secrets for.

  • List integration versions

    List deployed-version snapshots for an integration, newest first. Use this when the user wants to roll back a problematic deploy: each item carries a ``version`` number, the snapshotted code, and an ``is_published`` flag marking the currently-live version. Find the target version's ``id`` here, then pass it into ``revert_integration_version``. Versions are written by ``deploy_integration_version``; the in-progress code held on the integration itself (visible via ``get_integration``) is not a version until it is deployed. Args: ctx: MCP context (injected by FastMCP). integration_id: Integration to list versions for. limit: Cap on returned items. Default 10.

  • List matching criteria

    List matching criteria configured on a field. Use this to inspect HOW a field's extracted value is mapped to its attached data source — for example before tuning match behaviour, or to find the ``matching_criterion_id`` to update or delete. Only useful on fields that already have a data source attached; an unattached field returns an empty list. For the data source itself (rows, schema) use ``get_data_source`` and ``list_data_source_values``; matching criteria configure the lookup behaviour, not the data. Args: ctx: MCP context (injected by FastMCP). field_id: ID of the field whose matching criteria to list.

  • List model memory documents

    List the confirmed reference documents currently in a document type's model memory. Use this when the user asks about model memory directly, or wants an overview of the reference examples a document type draws on. Model memory is the set of confirmed documents the document type uses to guide extractions on similar docs. To find which example guided one *specific* document's extraction, don't list model memory — use ``get_document_extraction`` on that document and follow its ``reference_document_id`` instead. Skip this for routine extraction reviews — it's not needed to answer "what did we extract?". For the full configuration of the document type itself (fields, validation rules), use ``get_document_type_details``. To see one document's extraction, use ``get_document_extraction``. Args: ctx: MCP context (injected by FastMCP). document_type_id: Document type to query. limit: Cap on returned items. Default 50.

  • List organizations

    List organizations the current user belongs to. Use this as the starting point for almost any flow: an ``organization_id`` is required by ``list_workspaces``, ``create_workspace``, ``list_document_splitters``, ``get_usage`` and most onboarding tools. Each entry includes ``id``, ``name``, and ``identifier``; pick the org by name or confirm with the user when multiple are returned. For a single organization's details there is no dedicated getter — the fields returned here are the full public surface. Use ``update_organization`` to rename one. Args: ctx: MCP context (injected by FastMCP). limit: Cap on returned items. Default 20 — most users belong to only a handful of orgs.

  • List pipedream apps

    Search the catalogue of Pipedream apps available for new connections. Use this when ``list_integration_connections`` returns no connection for the service the user wants (e.g. they ask to push to Notion but no Notion connection exists). Find the right ``name_slug`` here, then pass it into ``create_connect_token`` to start the OAuth flow. Search is imprecise — prefer short, simple terms (``"sheets"`` rather than ``"google sheets"``). Already-connected services are returned by ``list_integration_connections``, not this tool. Args: ctx: MCP context (injected by FastMCP). search_query: Optional substring to filter app names. Omit to list everything.

  • List recent field annotations

    Spot-check how one field is being extracted across recent documents. Use this for short, focused quality checks on a single field — e.g. after tweaking its description, transformation, data source, or validation rules and wanting a quick read on how it behaves now. Returns the newest annotations first (one row per annotation; fields with ``multiple=True`` can yield several per document). Query one field at a time; do NOT call in parallel across fields. This is NOT a bulk export — for extracted data across many docs or fields, point users at the "Download extraction" UI. For all fields on one document, use ``get_document_extraction`` instead. Args: ctx: MCP context (injected by FastMCP). field_id: Field to query. filter_by: Document subset — ``any`` (default), ``review``, ``validated``, or ``in_model_memory``. limit: Cap on returned annotations. Default 25, hard-capped at 100. Keep this small for spot-checks.

  • List tags

    List the tags defined in a workspace. Use this to discover the ``tag_id`` for downstream tools, to check whether a tag with a given name already exists before creating one, or to show the user what tags are available. Tags are workspace-scoped labels that can be applied to any number of documents. To apply or remove a tag on documents use ``add_tag_to_documents`` / ``remove_tag_from_documents``. To see which tags a specific document carries, use ``get_document``. Args: ctx: MCP context (injected by FastMCP). workspace_id: Workspace to scope the list to. Required. limit: Cap on returned items. Default 100 — usually enough.

  • List validation rules

    List validation rules attached to a document type. Use this BEFORE creating a new validation rule — document types often have existing rules (including disabled ones) that already match the user's intent. If a matching rule exists, enable / tweak it via ``update_validation_rule`` rather than duplicating. Also use this to discover rule IDs for ``update_validation_rule`` / ``delete_validation_rule``. For one rule by ID, use ``get_validation_rule``. For the document type's fields (often needed when authoring rule prompts) use ``list_fields``. Args: ctx: MCP context (injected by FastMCP). document_type_id: Document type to scope the list to. limit: Cap on returned items. Default 100.

  • List workspaces

    List workspaces in an organization. Use this to discover existing workspaces — for example, to find the right workspace_id to pass into other tools, or to show the user what they already have set up. Each item includes document counts so you can also use this for a quick activity overview. For full settings (OCR mode, splitting, classification, model memory) use ``get_workspace_details`` on a specific workspace; ``list_workspaces`` intentionally returns a lean view. Args: ctx: MCP context (injected by FastMCP). organization_id: Organization to list workspaces for. Use the organization's ID, not its identifier. Required. limit: Cap on returned items. Default 20 — enough for most orgs.

  • Test connection

    Verify a service connection's credentials are still valid. Use this when an integration starts failing with auth-style errors, or when you want to confirm an OAuth flow finished successfully before relying on the connection. Returns ``is_valid=True`` if the upstream service accepts the stored credentials. To start a fresh OAuth flow rather than test an existing one, use ``create_connect_token``. To run an integration's Python code against a document, use ``run_integration`` — that exercises the full pipeline, not just credentials. Args: ctx: MCP context (injected by FastMCP). connection_id: ID of the connection to test.

  • 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 2 / 2