> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to the Affinda MCP server

The Affinda MCP connector routes your AI agent's tool calls to Affinda's own MCP server through Scalekit. Each user signs in to Affinda once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 85 tools.

**Authentication:** OAuth2.1/DCR
**Categories:** AI, Files & Documents
**Tools:** 85: 35 read, 36 write, 14 destructive
**Users sign in with:** OAuth
**OAuth app:** Scalekit's or your own
**Built by:** Vendor MCP
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=AFFINDAMCP)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Affinda MCP connection

   In **AgentKit > Connections**, create an Affinda MCP connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

   Scalekit credentials are available for Affinda MCP server, so you don't need to register an OAuth app.

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'affindamcp'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Affinda MCP:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'affindamcp_list_organizations',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "affindamcp"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Affinda MCP:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="affindamcp_list_organizations",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user signs in once. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'affindamcp_get_data_source',
  toolInput: {
    data_source_id: '<data_source_id>',
  },
  connector: 'affindamcp',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="affindamcp_get_data_source",
    tool_input={
        "data_source_id": "<data_source_id>",
    },
    connection_name="affindamcp",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `affindamcp_get_data_source`

Get data source · Read-only

Get one data source by ID â name, schema, and key/display properties.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `data_source_id` (`string`, required): No description.

Example input: `{"data_source_id":"<data_source_id>"}`

### `affindamcp_get_document`

Get document · Read-only

Get one document by ID â state, workspace, document type, and basic metadata.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): No description.

Example input: `{"document_id":"<document_id>"}`

### `affindamcp_get_document_extraction`

Get document extraction · Read-only

Get the extracted data for one document â raw text plus all field values.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): No description.

Example input: `{"document_id":"<document_id>"}`

### `affindamcp_get_document_page_images`

Get document page images · Read-only

View a document's pages as rendered images, to see the actual document rather than just OCR text. Use this when the visual appearance of a document matters and text alone is ambiguous — layout questions, checkboxes and selection marks, signatures, stamps, handwriting, logos, or diagnosing why extraction misread something. The images show each page as it appears in the document review UI. With show_annotations, the extracted annotations are drawn on top of each page as colored rectangles tagged with their field slug — use this to check where a value was read from (wrong instance picked, value attributed to the wrong field, table rows/columns mapped incorrectly). On dense documents, pass field_slugs to only draw the fields you are debugging (a table's slug also draws its cells). Images are expensive in tokens — request only the pages you need, at most 5 per call. For extracted values and raw text, use get_document_extraction instead; only reach for images when text output isn't enough.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_id` (`string`, required): ID of the document to view.
- `field_slugs` (`array`, optional): Only draw annotations for these field slugs (implies show_annotations). Omit to draw all annotated fields.
- `page_indices` (`array`, optional): Zero-based page indices to fetch (e.g. [0] for the first page). Omit to get the first 5 pages. Request at most 5 pages per call.
- `show_annotations` (`boolean`, optional): Draw the extracted annotations on the page images as colored rectangles labelled with their field slug. Default: `false`.

Example input: `{"document_id":"<document_id>"}`

### `affindamcp_get_document_type`

Get document type · Read-only

Get one document type by ID â name, organization, and counts only.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_type_id` (`string`, required): No description.

Example input: `{"document_type_id":"<document_type_id>"}`

### `affindamcp_get_document_type_details`

Get document type details · Read-only

Get a document type's full configuration â settings + counts.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_type_id` (`string`, required): No description.

Example input: `{"document_type_id":"<document_type_id>"}`

### `affindamcp_get_field`

Get field · Read-only

Get one field by ID â full settings, formatter, and relationships.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `field_id` (`string`, required): No description.

Example input: `{"field_id":"<field_id>"}`

### `affindamcp_get_field_group`

Get field group · Read-only

Get one field group by ID â label, position, parent document type.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `field_group_id` (`string`, required): No description.

Example input: `{"field_group_id":"<field_group_id>"}`

### `affindamcp_get_integration`

Get integration · Read-only

Get one integration by ID â full configuration, code, and connections.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `integration_id` (`string`, required): No description.

Example input: `{"integration_id":"<integration_id>"}`

### `affindamcp_get_integration_run`

Get integration run · Read-only

Get one integration run by ID â full, untruncated logs and output.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `integration_run_id` (`string`, required): No description.

Example input: `{"integration_run_id":"<integration_run_id>"}`

### `affindamcp_get_usage`

Get usage · Read-only

Get daily credits consumption for an organization over a date range.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `organization_id` (`string`, required): No description.
- `document_type_id` (`string`, optional): No description.
- `end_date` (`string`, optional): No description.
- `start_date` (`string`, optional): No description.
- `workspace_id` (`string`, optional): No description.

Example input: `{"organization_id":"<organization_id>"}`

### `affindamcp_get_validation_rule`

Get validation rule · Read-only

Get one validation rule by ID â prompt, enabled, fields, missing-data option.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `validation_rule_id` (`string`, required): No description.

Example input: `{"validation_rule_id":"<validation_rule_id>"}`

### `affindamcp_get_workspace`

Get workspace · Read-only

Get one workspace by ID â name, organization, and document counts only.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): No description.

Example input: `{"workspace_id":"<workspace_id>"}`

### `affindamcp_get_workspace_details`

Get workspace details · Read-only

Get a workspace's full configuration â settings + counts.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): No description.

Example input: `{"workspace_id":"<workspace_id>"}`

### `affindamcp_list_data_source_values`

List data source values · Read-only

List the rows (records) stored in a data source.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `data_source_id` (`string`, required): No description.
- `limit` (`integer`, optional): No description. Default: `100`.

Example input: `{"data_source_id":"<data_source_id>"}`

### `affindamcp_list_data_sources`

List data sources · Read-only

List data sources (lookup tables) defined on an organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `organization_id` (`string`, required): No description.
- `limit` (`integer`, optional): No description. Default: `20`.

Example input: `{"organization_id":"<organization_id>"}`

### `affindamcp_list_document_splitters`

List document splitters · Read-only

List document splitters available to an organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `organization_id` (`string`, required): No description.

Example input: `{"organization_id":"<organization_id>"}`

### `affindamcp_list_document_types`

List document types · Read-only

List document types in an organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `organization_id` (`string`, required): No description.
- `limit` (`integer`, optional): No description. Default: `50`.

Example input: `{"organization_id":"<organization_id>"}`

### `affindamcp_list_documents`

List documents · Read-only

List documents in a workspace with their state and basic metadata.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): No description.
- `limit` (`integer`, optional): No description. Default: `20`.
- `search_text` (`string`, optional): No description.
- `state` (`string`, optional): No description.

Example input: `{"workspace_id":"<workspace_id>"}`

### `affindamcp_list_fields`

List fields · Read-only

List a document type's full field schema, grouped by field group.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_type_id` (`string`, required): No description.

Example input: `{"document_type_id":"<document_type_id>"}`

### `affindamcp_list_integration_connections`

List integration connections · Read-only

List third-party service connections in an organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `organization_id` (`string`, required): No description.

Example input: `{"organization_id":"<organization_id>"}`

### `affindamcp_list_integration_runs`

List integration runs · Read-only

List recent runs for an integration, newest first.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `integration_id` (`string`, required): No description.
- `limit` (`integer`, optional): No description. Default: `5`.

Example input: `{"integration_id":"<integration_id>"}`

### `affindamcp_list_integration_secrets`

List Integration Secrets · Read-only

List the names of secrets configured for an integration.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `integration_id` (`string`, required): No description.

Example input: `{"integration_id":"<integration_id>"}`

### `affindamcp_list_integration_versions`

List integration versions · Read-only

List deployed-version snapshots for an integration, newest first.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `integration_id` (`string`, required): No description.
- `limit` (`integer`, optional): No description. Default: `10`.

Example input: `{"integration_id":"<integration_id>"}`

### `affindamcp_list_integrations`

List integrations · Read-only

List integrations in an organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `organization_id` (`string`, required): No description.
- `enabled` (`string`, optional): No description.
- `limit` (`integer`, optional): No description. Default: `20`.
- `workspace_id` (`string`, optional): No description.

Example input: `{"organization_id":"<organization_id>"}`

### `affindamcp_list_matching_criteria`

List matching criteria · Read-only

List matching criteria configured on a field.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `field_id` (`string`, required): No description.

Example input: `{"field_id":"<field_id>"}`

### `affindamcp_list_model_memory_documents`

List model memory documents · Read-only

List the confirmed reference documents currently in a document type's model memory.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_type_id` (`string`, required): No description.
- `limit` (`integer`, optional): No description. Default: `50`.

Example input: `{"document_type_id":"<document_type_id>"}`

### `affindamcp_list_organizations`

List organizations · Read-only

List organizations the current user belongs to.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `limit` (`integer`, optional): No description. Default: `20`.

Example input: `{}`

### `affindamcp_list_pipedream_apps`

List pipedream apps · Read-only

Search the catalogue of Pipedream apps available for new connections.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `search_query` (`string`, optional): No description.

Example input: `{}`

### `affindamcp_list_recent_field_annotations`

List recent field annotations · Read-only

Spot-check how one field is being extracted across recent documents.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `field_id` (`string`, required): No description.
- `filter_by` (`string`, optional): No description. One of: `any`, `review`, `validated`, `in_model_memory`. Default: `any`.
- `limit` (`integer`, optional): No description. Default: `25`.

Example input: `{"field_id":"<field_id>"}`

### `affindamcp_list_tags`

List tags · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): Workspace to scope the list to. Required.
- `limit` (`integer`, optional): Cap on returned items. Default 100 — usually enough. Default: `100`.

Example input: `{"workspace_id":"<workspace_id>"}`

### `affindamcp_list_validation_rules`

List validation rules · Read-only

List validation rules attached to a document type.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_type_id` (`string`, required): No description.
- `limit` (`integer`, optional): No description. Default: `100`.

Example input: `{"document_type_id":"<document_type_id>"}`

### `affindamcp_list_workspaces`

List workspaces · Read-only

List workspaces in an organization.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `organization_id` (`string`, required): No description.
- `limit` (`integer`, optional): No description. Default: `20`.

Example input: `{"organization_id":"<organization_id>"}`

### `affindamcp_test_connection`

Test connection · Read-only

Verify a service connection's credentials are still valid.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `connection_id` (`string`, required): No description.

Example input: `{"connection_id":"<connection_id>"}`

### `affindamcp_wait_for_document_processing`

Wait for document processing · Read-only

Block until every document in a workspace has finished processing.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): No description.
- `timeout_seconds` (`integer`, optional): No description. Default: `120`.

Example input: `{"workspace_id":"<workspace_id>"}`

### `affindamcp_add_connection_to_integration`

Add connection to integration · Write

Attach an existing service connection to an integration.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `connection_id` (`string`, required): No description.
- `integration_id` (`string`, required): No description.

Example input: `{"connection_id":"<connection_id>","integration_id":"<integration_id>"}`

### `affindamcp_add_tag_to_documents`

Add tag to documents · Write

Apply an existing tag to one or more documents. Use this to label documents — e.g. "tag these three invoices as Urgent". Documents that already carry the tag are unaffected (the operation is idempotent). All documents must belong to the same workspace as the tag. The tag must already exist — find its ID with list_tags or create it first with create_tag.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_ids` (`array`, required): Documents to tag.
- `tag_id` (`string`, required): ID of the tag to apply.

Example input: `{"document_ids":[],"tag_id":"<tag_id>"}`

### `affindamcp_archive_documents`

Archive documents · Write

Move documents to ``archived`` state.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_ids` (`array`, required): No description.

Example input: `{"document_ids":[]}`

### `affindamcp_assign_document_type_to_workspace`

Assign document type to workspace · Write

Make a document type available for use in a workspace.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_type_id` (`string`, required): No description.
- `workspace_id` (`string`, required): No description.

Example input: `{"document_type_id":"<document_type_id>","workspace_id":"<workspace_id>"}`

### `affindamcp_bulk_create_data_source_values`

Bulk create data source values · Write

Append many new rows to a data source in one call.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `data_source_id` (`string`, required): No description.
- `values` (`array`, required): No description.

Example input: `{"data_source_id":"<data_source_id>","values":[]}`

### `affindamcp_bulk_create_fields`

Bulk create fields · Write

Create many fields on a document type in one call.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `document_type_id` (`string`, required): No description.
- `fields` (`array`, required): No description.
- `field_group_id` (`string`, optional): No description.

Example input: `{"document_type_id":"<document_type_id>","fields":[]}`

### `affindamcp_confirm_documents`

Confirm documents · Write

Mark documents as validated, moving them from ``review`` to ``validated``.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_ids` (`array`, required): No description.

Example input: `{"document_ids":[]}`

### `affindamcp_create_api_token`

Create API token · Write

Create a new long-lived Affinda API key for the current user.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs: none.

Example input: `{}`

### `affindamcp_create_connect_token`

Create connect token · Write

Mint an OAuth connect token + URL so the user can authorise a service.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `connection_id` (`string`, required): No description.

Example input: `{"connection_id":"<connection_id>"}`

### `affindamcp_create_data_source`

Create data source · Write

Create an empty data source (lookup table) in an organization.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): No description.
- `organization_id` (`string`, required): No description.
- `display_property` (`string`, optional): No description. Default: `label`.
- `key_property` (`string`, optional): No description. Default: `value`.
- `schema_definition` (`string`, optional): No description.

Example input: `{"name":"<name>","organization_id":"<organization_id>"}`

### `affindamcp_create_data_source_value`

Create data source value · Write

Add one new row to a data source.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `data_source_id` (`string`, required): No description.
- `value` (`string`, required): No description.

Example input: `{"data_source_id":"<data_source_id>","value":"<value>"}`

### `affindamcp_create_document_type`

Create document type · Write

Create a new document type (extraction template) in an organization.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): No description.
- `organization_id` (`string`, required): No description.
- `disable_confirmation_if_validation_rules_fail` (`boolean`, optional): No description. Default: `false`.

Example input: `{"name":"<name>","organization_id":"<organization_id>"}`

### `affindamcp_create_field`

Create field · Write

Create a single field on a document type.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `document_type_id` (`string`, required): No description.
- `field_type` (`string`, required): No description. One of: `text`, `float`, `integer`, `decimal`, `date`, `datetime`, `daterange`, `enum`, `options`, `boolean`, `checkedboxtext`, `checkedboxboolean`, `location`, `phonenumber`, `url`, `group`, `table`, `signature`, `headshot`, `seal`.
- `label` (`string`, required): No description.
- `slug` (`string`, required): No description.
- `decimal_places` (`string`, optional): No description.
- `description` (`string`, optional): No description.
- `enabled` (`boolean`, optional): No description. Default: `true`.
- `field_group_id` (`string`, optional): No description.
- `manual_entry` (`boolean`, optional): No description. Default: `false`.
- `mapping_data_source_id` (`string`, optional): No description.
- `multiple` (`boolean`, optional): No description. Default: `false`.
- `no_rect` (`boolean`, optional): No description. Default: `false`.
- `options` (`string`, optional): No description.
- `parent_id` (`string`, optional): No description.
- `transformation_prompt` (`string`, optional): No description.

Example input: `{"document_type_id":"<document_type_id>","field_type":"text","label":"<label>","slug":"<slug>"}`

### `affindamcp_create_field_group`

Create field group · Write

Create a field group (heading/section) on a document type.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `document_type_id` (`string`, required): No description.
- `label` (`string`, required): No description.

Example input: `{"document_type_id":"<document_type_id>","label":"<label>"}`

### `affindamcp_create_integration`

Create integration · Write

Create a new, empty integration in an organization.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): No description.
- `organization_id` (`string`, required): No description.
- `description` (`string`, optional): No description. Default: ``.

Example input: `{"name":"<name>","organization_id":"<organization_id>"}`

### `affindamcp_create_matching_criterion`

Create matching criterion · Write

Add a matching criterion to a field with an attached data source.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `data_source_property` (`string`, required): No description.
- `field_id` (`string`, required): No description.
- `source_field_id` (`string`, required): No description.
- `field_attribute` (`string`, optional): No description.
- `match_type` (`string`, optional): No description. One of: `match`, `match_phrase`, `term`. Default: `match`.
- `required` (`boolean`, optional): No description. Default: `false`.
- `required_strict` (`boolean`, optional): No description. Default: `false`.

Example input: `{"data_source_property":"<data_source_property>","field_id":"<field_id>","source_field_id":"<source_field_id>"}`

### `affindamcp_create_recruit_workspace`

Create recruit workspace · Write

Create a fully-configured Recruitment workspace in one call.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `organization_id` (`string`, required): No description.

Example input: `{"organization_id":"<organization_id>"}`

### `affindamcp_create_tag`

Create tag · Write

Create a new tag in a workspace. Use this when the user wants a new label to organise documents — e.g. "create an Urgent tag", "add a tag for Q3 invoices". The tag starts with no documents attached; apply it with add_tag_to_documents. Tag names must be unique within a workspace. Check list_tags first if you're unsure whether the tag already exists.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Tag name (e.g. Urgent, Q3 Invoices). Max 256 chars.
- `workspace_id` (`string`, required): Workspace the tag belongs to.

Example input: `{"name":"<name>","workspace_id":"<workspace_id>"}`

### `affindamcp_create_validation_rule`

Create validation rule · Write

Create a validation rule for a document type.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `document_type_id` (`string`, required): No description.
- `prompt` (`string`, required): No description.
- `enabled` (`boolean`, optional): No description. Default: `true`.
- `field_ids` (`string`, optional): No description.
- `missing_data_option` (`string`, optional): No description.

Example input: `{"document_type_id":"<document_type_id>","prompt":"<prompt>"}`

### `affindamcp_create_validation_run`

Create validation run · Write

Run a validation rule against a document and refresh its results.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `validation_rule_id` (`string`, required): No description.
- `document_id` (`string`, optional): No description.
- `document_type_id` (`string`, optional): No description.

Example input: `{"validation_rule_id":"<validation_rule_id>"}`

### `affindamcp_create_workspace`

Create workspace · Write

Create a new workspace with chosen processing settings.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): No description.
- `organization_id` (`string`, required): No description.
- `document_splitter_id` (`string`, optional): No description.
- `enable_document_classification` (`boolean`, optional): No description. Default: `true`.
- `enable_document_splitting` (`boolean`, optional): No description. Default: `false`.
- `model_memory_strategy` (`string`, optional): No description. One of: `auto`, `manual`, `always`. Default: `auto`.
- `ocr_mode` (`string`, optional): No description. One of: `auto-detect`, `always-full`, `always-partial`, `skip`. Default: `auto-detect`.
- `reject_duplicates` (`boolean`, optional): No description. Default: `true`.
- `visibility` (`string`, optional): No description. One of: `organization`, `private`. Default: `organization`.

Example input: `{"name":"<name>","organization_id":"<organization_id>"}`

### `affindamcp_populate_document_type_fields`

Populate document type fields · Write

Auto-suggest fields for a document type by analysing sample documents.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `document_ids` (`array`, required): No description.
- `document_type_id` (`string`, required): No description.
- `instructions` (`string`, optional): No description.

Example input: `{"document_ids":[],"document_type_id":"<document_type_id>"}`

### `affindamcp_reassign_document_type`

Reassign document type · Write

Reassign documents to a different document type in the same workspace.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_ids` (`array`, required): No description.
- `document_type_id` (`string`, required): No description.
- `reparse` (`boolean`, optional): No description. Default: `true`.

Example input: `{"document_ids":[],"document_type_id":"<document_type_id>"}`

### `affindamcp_reject_documents`

Reject documents · Write

Move documents to ``rejected`` state.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_ids` (`array`, required): No description.

Example input: `{"document_ids":[]}`

### `affindamcp_remove_tag_from_documents`

Remove tag from documents · Write

Take a tag off one or more documents. Use this to un-label documents — e.g. "remove the Urgent tag from these invoices". The tag itself is kept and stays available for other documents; documents that don't carry the tag are unaffected. To delete the tag everywhere in one step, use delete_tag instead.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_ids` (`array`, required): Documents to remove the tag from.
- `tag_id` (`string`, required): ID of the tag to remove.

Example input: `{"document_ids":[],"tag_id":"<tag_id>"}`

### `affindamcp_set_integration_secret`

Set Integration Secret · Write

Create or update a secret on an integration. The value is stored only as
an environment variable on the Lambda function â never in the database.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `integration_id` (`string`, required): No description.
- `name` (`string`, required): No description.
- `value` (`string`, required): No description.

Example input: `{"integration_id":"<integration_id>","name":"<name>","value":"<value>"}`

### `affindamcp_update_data_source`

Update data source · Write

Update top-level settings on a data source (name, key, display property).

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `data_source_id` (`string`, required): No description.
- `display_property` (`string`, optional): No description.
- `key_property` (`string`, optional): No description.
- `name` (`string`, optional): No description.

Example input: `{"data_source_id":"<data_source_id>"}`

### `affindamcp_update_data_source_value`

Update data source value · Write

Update one row in a data source by its key â partial merge.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `data_source_id` (`string`, required): No description.
- `key` (`string`, required): No description.
- `value` (`string`, required): No description.

Example input: `{"data_source_id":"<data_source_id>","key":"<key>","value":"<value>"}`

### `affindamcp_update_document_type`

Update document type · Write

Update one or more settings on an existing document type.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `document_type_id` (`string`, required): No description.
- `auto_refresh_validation_results` (`string`, optional): No description.
- `disable_confirmation_if_validation_rules_fail` (`string`, optional): No description.
- `name` (`string`, optional): No description.
- `show_redact_button` (`string`, optional): No description.

Example input: `{"document_type_id":"<document_type_id>"}`

### `affindamcp_update_field`

Update field · Write

Update one or more settings on an existing field.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `field_id` (`string`, required): No description.
- `auto_confirm_if_validation_rules_pass` (`string`, optional): No description.
- `decimal_places` (`string`, optional): No description.
- `description` (`string`, optional): No description.
- `display_enum_value` (`string`, optional): No description.
- `display_raw_text` (`string`, optional): No description.
- `drop_null` (`string`, optional): No description.
- `enabled` (`string`, optional): No description.
- `field_group_id` (`string`, optional): No description.
- `field_type` (`string`, optional): No description.
- `hide_enum_detail` (`string`, optional): No description.
- `label` (`string`, optional): No description.
- `manual_entry` (`string`, optional): No description.
- `mapping_data_source_id` (`string`, optional): No description.
- `multiple` (`string`, optional): No description.
- `no_rect` (`string`, optional): No description.
- `options` (`string`, optional): No description.
- `position` (`string`, optional): No description.
- `return_first_instance_only` (`string`, optional): No description.
- `slug` (`string`, optional): No description.
- `transformation_prompt` (`string`, optional): No description.

Example input: `{"field_id":"<field_id>"}`

### `affindamcp_update_integration`

Update integration · Write

Update one or more settings â including code â on an integration.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `integration_id` (`string`, required): No description.
- `description` (`string`, optional): No description.
- `document_type_id` (`string`, optional): No description.
- `enabled` (`string`, optional): No description.
- `event` (`string`, optional): No description.
- `name` (`string`, optional): No description.
- `python_code` (`string`, optional): No description.
- `workspace_id` (`string`, optional): No description.

Example input: `{"integration_id":"<integration_id>"}`

### `affindamcp_update_matching_criterion`

Update matching criterion · Write

Update settings on an existing matching criterion.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `matching_criterion_id` (`string`, required): No description.
- `data_source_property` (`string`, optional): No description.
- `field_attribute` (`string`, optional): No description.
- `match_type` (`string`, optional): No description.
- `required` (`string`, optional): No description.
- `required_strict` (`string`, optional): No description.
- `source_field_id` (`string`, optional): No description.

Example input: `{"matching_criterion_id":"<matching_criterion_id>"}`

### `affindamcp_update_organization`

Update organization · Write

Rename an organization.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): No description.
- `organization_id` (`string`, required): No description.

Example input: `{"name":"<name>","organization_id":"<organization_id>"}`

### `affindamcp_update_tag`

Update tag · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): New tag name. Max 256 chars.
- `tag_id` (`string`, required): ID of the tag to rename.

Example input: `{"name":"<name>","tag_id":"<tag_id>"}`

### `affindamcp_update_validation_rule`

Update validation rule · Write

Update one or more settings on an existing validation rule.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `validation_rule_id` (`string`, required): No description.
- `enabled` (`string`, optional): No description.
- `field_ids` (`string`, optional): No description.
- `generate_code` (`boolean`, optional): No description. Default: `false`.
- `missing_data_option` (`string`, optional): No description.
- `prompt` (`string`, optional): No description.

Example input: `{"validation_rule_id":"<validation_rule_id>"}`

### `affindamcp_update_workspace`

Update workspace · Write

Update one or more settings on an existing workspace.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `workspace_id` (`string`, required): No description.
- `auto_validation` (`string`, optional): No description.
- `document_splitter_id` (`string`, optional): No description.
- `enable_document_classification` (`string`, optional): No description.
- `enable_document_splitting` (`string`, optional): No description.
- `enable_validation` (`string`, optional): No description.
- `model_memory_strategy` (`string`, optional): No description.
- `name` (`string`, optional): No description.
- `ocr_mode` (`string`, optional): No description.
- `reject_duplicates` (`string`, optional): No description.
- `visibility` (`string`, optional): No description.

Example input: `{"workspace_id":"<workspace_id>"}`

### `affindamcp_delete_data_source`

Delete data source · Destructive

Delete a data source and every row it contains.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `data_source_id` (`string`, required): No description.

Example input: `{"data_source_id":"<data_source_id>"}`

### `affindamcp_delete_data_source_value`

Delete data source value · Destructive

Delete one row from a data source by its key.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `data_source_id` (`string`, required): No description.
- `key` (`string`, required): No description.

Example input: `{"data_source_id":"<data_source_id>","key":"<key>"}`

### `affindamcp_delete_document_type`

Delete document type · Destructive

Delete a document type permanently.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `document_type_id` (`string`, required): No description.
- `delete_documents` (`boolean`, optional): No description. Default: `false`.

Example input: `{"document_type_id":"<document_type_id>"}`

### `affindamcp_delete_field`

Delete field · Destructive

Delete a single field from a document type.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `field_id` (`string`, required): No description.

Example input: `{"field_id":"<field_id>"}`

### `affindamcp_delete_field_group`

Delete field group · Destructive

Delete a field group (heading/section) from a document type.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `field_group_id` (`string`, required): No description.

Example input: `{"field_group_id":"<field_group_id>"}`

### `affindamcp_delete_integration`

Delete integration · Destructive

Permanently delete an integration.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `integration_id` (`string`, required): No description.

Example input: `{"integration_id":"<integration_id>"}`

### `affindamcp_delete_integration_secret`

Delete Integration Secret · Destructive

Permanently delete a secret. Removes both the database record and the
Lambda environment variable.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `secret_id` (`string`, required): No description.

Example input: `{"secret_id":"<secret_id>"}`

### `affindamcp_delete_matching_criterion`

Delete matching criterion · Destructive

Delete a matching criterion from a field.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `matching_criterion_id` (`string`, required): No description.

Example input: `{"matching_criterion_id":"<matching_criterion_id>"}`

### `affindamcp_delete_tag`

Delete tag · Destructive

Delete a tag from its workspace. Use this only when the user explicitly wants the tag gone — e.g. "delete the Urgent tag". The tag is removed from every document that carried it; the documents themselves are untouched. To take the tag off specific documents while keeping it available for others, use remove_tag_from_documents instead.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `tag_id` (`string`, required): ID of the tag to delete.

Example input: `{"tag_id":"<tag_id>"}`

### `affindamcp_delete_validation_rule`

Delete validation rule · Destructive

Delete a validation rule from a document type.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `validation_rule_id` (`string`, required): No description.

Example input: `{"validation_rule_id":"<validation_rule_id>"}`

### `affindamcp_deploy_integration_version`

Deploy integration version · Destructive

Snapshot the integration's current code as a new version and deploy it.

Call this immediately after every successful ``update_integration``
that changed ``python_code`` â it MUST be the next tool call. Code
saved on the integration is not live until deployed, and
``run_integration`` always executes the deployed version, so skipping
this step means tests run stale code and real document events still
fire the previous version.

To roll back a bad deploy, use ``revert_integration_version`` wi...

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `integration_id` (`string`, required): No description.

Example input: `{"integration_id":"<integration_id>"}`

### `affindamcp_remove_connection_from_integration`

Remove connection from integration · Destructive

Detach a service connection from an integration.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `connection_id` (`string`, required): No description.
- `integration_id` (`string`, required): No description.

Example input: `{"connection_id":"<connection_id>","integration_id":"<integration_id>"}`

### `affindamcp_revert_integration_version`

Revert integration version · Destructive

Roll an integration back to a previous version and redeploy it.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `integration_id` (`string`, required): No description.
- `version_id` (`string`, required): No description.

Example input: `{"integration_id":"<integration_id>","version_id":"<version_id>"}`

### `affindamcp_run_integration`

Run integration · Destructive

Execute an integration against one document as a test run.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `document_id` (`string`, required): No description.
- `integration_id` (`string`, required): No description.

Example input: `{"document_id":"<document_id>","integration_id":"<integration_id>"}`

## Related

Other AI connectors ([all 116](/agentkit/connectors/?category=ai)):

- [Chorus](/agentkit/connectors/chorus/): Scalekit connector, Username and password, 9 tools
- [Gong](/agentkit/connectors/gong/): Scalekit connector, OAuth, 49 tools
- [Jiminny](/agentkit/connectors/jiminny/): Scalekit connector, Access token, 27 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
