Tool reference · Directories and organizations

import_contacts

Import contacts into a group

Owners

POST /v1/actions/import_contacts · MCP tool import_contacts

Imports contacts into a group, for its directory’s owners: up to 500 contacts a call, or a whole subscriber list or contacts file in contacts_file. Any group but the user’s Private Contacts (private_contacts in my_access), which add_to_private_contacts alone fills. Each number, email, address and link goes in fields, labeled for what it is (phone mobile, home, work, main or other; email home, work, school or other), never in a note or the name. A mobile number the directory already has is that contact, which joins the group and gets each field it has no value for, never changing what it has; filled counts them. Nothing else matches, so possible_duplicates lists contacts that may be one person, the same email, number or name, which merge_contacts merges. Each contact’s note is for everyone the groups’ Notes rule shows notes to, so put what people should know about it there as you add it, and note_only_you only what’s for the user alone; importing again adds a note only where the contact doesn’t have it word for word. A photo is a field, { type: "photo", value: base64, or an https link up to 15 MB }. Past the plan’s room for contacts, the import is refused whole, saying how many fit; ask the user, then call again with add_what_fits, and left_out says how many waited.

View as Markdown

Parameters

ParameterTypeRequiredLimitsWhat
groupstringrequired
contacts{ name: string, fields: { type: "phone" | "email" | "address" | "url" | "birthday" | "company" | "title" | "note" | "social" | "photo", label?: string, value: string }[], note?: string, note_only_you?: string }[]optionalup to 500, default []
contacts_file{ download_url: string, file_id: string, mime_type?: string, file_name?: string }optionalA subscriber list or contacts file the user attached in ChatGPT, read whole by Openbook in this one call: a CSV, like the subscriber export of a groups.io group or Google Group they own or moderate, or a spreadsheet saved as one, with a name column and an email or phone column, or a vCard file. Its names, numbers, emails, addresses and links come in, any number of them.
add_what_fitsbooleanoptionalPast the plan’s room for contacts, add the new ones that fit, in order, and leave the rest, once the user agrees. Off until set, when an import past the room is refused whole.

Who can use it

Owners of an organization have it, and each call is checked against which organizations they own. A person’s tool list only includes it when they can use it, and clients like ChatGPT see the same list.

Errors

Errors carry a stable code and a message written for people. See errors and their status codes.

curl https://api.withopenbook.com/v1/actions/import_contacts \
  -H "Authorization: Bearer $OPENBOOK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "group": "a1c4e7f0-2b5d-4c8e-9f1a-3b6d9e2c5f80",
  "contacts": [
    {
      "name": "Dana Diaz",
      "fields": [
        {
          "type": "phone",
          "label": "mobile",
          "value": "(415) 555-0155"
        }
      ]
    },
    {
      "name": "Chris Cho",
      "fields": [
        {
          "type": "phone",
          "label": "mobile",
          "value": "(415) 555-0128"
        }
      ]
    }
  ]
}'
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "import_contacts",
    "arguments": {
      "group": "a1c4e7f0-2b5d-4c8e-9f1a-3b6d9e2c5f80",
      "contacts": [
        {
          "name": "Dana Diaz",
          "fields": [
            {
              "type": "phone",
              "label": "mobile",
              "value": "(415) 555-0155"
            }
          ]
        },
        {
          "name": "Chris Cho",
          "fields": [
            {
              "type": "phone",
              "label": "mobile",
              "value": "(415) 555-0128"
            }
          ]
        }
      ]
    }
  }
}