LegalStack
MCP

Registry

Реестры: таблицы, записи, колонки

Подключение: https://mcp.legalstack.ru/mcp/registry или в составе агрегированного сервера https://mcp.legalstack.ru/mcp.

Имя сервера: legalstack-registry. Инструментов: 30.

create_folder

Создать папку для реестров. Возвращает: текст-подтверждение с названием и ID папки.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Название папки"
    },
    "dropboxPath": {
      "description": "Путь в Dropbox для синхронизации",
      "type": "string"
    }
  },
  "required": [
    "name"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

create_record

Создать запись в реестре. Сначала узнай поля через get_registry; передавай все данные сразу. Возвращает: объект созданной записи { id, typeId, data, createdAt, updatedAt }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "data": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {},
      "description": "Данные записи: ключ = имя поля, значение = данные"
    }
  },
  "required": [
    "registryId",
    "data"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

create_registry

Создать новый реестр с набором полей. Возвращает: текст-подтверждение с названием и ID реестра.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Название реестра"
    },
    "description": {
      "description": "Описание",
      "type": "string"
    },
    "icon": {
      "description": "Иконка",
      "type": "string"
    },
    "fields": {
      "description": "Поля реестра",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "description": "Системный ключ поля (латиницей); по умолчанию транслитерируется из name",
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Отображаемое название поля"
          },
          "dataType": {
            "description": "Тип поля: text (по умолчанию), number, date, select, email, phone",
            "type": "string"
          },
          "required": {
            "description": "Обязательность заполнения поля",
            "type": "boolean"
          },
          "options": {
            "description": "Настройки поля; для select: { \"items\": [\"Вариант 1\", \"Вариант 2\"] }",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "name"
        ]
      }
    }
  },
  "required": [
    "name"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

create_registry_from_spreadsheet

Создать новый реестр из файла во внешнем облаке (provider): создаёт реестр с полями и импортирует данные. Для импорта в существующий реестр — import_cloud_spreadsheet. Возвращает: текст с ID нового реестра и числом записей.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "enum": [
        "google_drive",
        "dropbox"
      ],
      "description": "Облачное хранилище"
    },
    "fileId": {
      "type": "string",
      "description": "ID файла (Google Drive) или путь к файлу (Dropbox)"
    },
    "registryName": {
      "type": "string",
      "description": "Название нового реестра"
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Системное имя поля (латиницей; на него ссылается columnMapping)"
          },
          "name": {
            "type": "string",
            "description": "Отображаемое название поля"
          },
          "dataType": {
            "type": "string",
            "description": "Тип поля: text, number, date, select, email, phone"
          }
        },
        "required": [
          "key",
          "name",
          "dataType"
        ]
      },
      "description": "Поля нового реестра"
    },
    "columnMapping": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      },
      "description": "Маппинг колонок файла на поля реестра: {название_колонки: key_поля}"
    }
  },
  "required": [
    "provider",
    "fileId",
    "registryName",
    "fields",
    "columnMapping"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

create_source

Создать источник данных для реестра. Возвращает: текст-подтверждение с названием и ID источника.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "name": {
      "type": "string",
      "description": "Название источника"
    },
    "type": {
      "type": "string",
      "description": "Тип источника"
    },
    "config": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {},
      "description": "Конфигурация источника"
    }
  },
  "required": [
    "registryId",
    "name",
    "type",
    "config"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

delete_folder

Удаляет папку реестров. Реестры внутри не удаляются — перемещаются в корень. Возвращает: текст «Папка удалена».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "folderId": {
      "type": "string",
      "description": "ID папки"
    }
  },
  "required": [
    "folderId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

delete_record

⚠ Необратимо удаляет запись из реестра. Восстановления нет. Возвращает: объект { id, typeId, deleted: true }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "recordId": {
      "type": "string",
      "description": "ID записи"
    }
  },
  "required": [
    "registryId",
    "recordId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

delete_registry

⚠ Необратимо удаляет реестр со всеми его записями. Восстановления нет. Возвращает: текст «Реестр удалён».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    }
  },
  "required": [
    "registryId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

delete_source

⚠ Необратимо удаляет источник данных реестра. Восстановления нет. Возвращает: текст «Источник удалён».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "sourceId": {
      "type": "string",
      "description": "ID источника"
    }
  },
  "required": [
    "sourceId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

export_registry_to_cloud

⚠ Outward-facing: выгружает реестр как XLSX во внешнее облако (provider). Возвращает: текст-подтверждение с именем файла и размером.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "provider": {
      "type": "string",
      "enum": [
        "google_drive",
        "dropbox"
      ],
      "description": "Облачное хранилище"
    },
    "folderId": {
      "description": "ID/путь папки в облаке",
      "type": "string"
    }
  },
  "required": [
    "registryId",
    "provider"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

generate_registry_file

Сгенерировать XLSX-файл из реестра и вернуть его содержимым (base64). Ничего не отправляет; для выгрузки в облако — export_registry_to_cloud. Возвращает: объект { fileName, format, sizeKB, contentBase64 }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    }
  },
  "required": [
    "registryId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

get_record

Запись реестра по ID. Только чтение. Возвращает: объект { id, typeId, data, createdAt, updatedAt }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "recordId": {
      "type": "string",
      "description": "ID записи"
    }
  },
  "required": [
    "registryId",
    "recordId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

get_registry

Реестр по ID с полной схемой полей и триггерами. Только чтение. Вызови перед create_record/update_record, чтобы знать поля. Возвращает: объект { id, name, description, icon, folderId, fields, triggers }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    }
  },
  "required": [
    "registryId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

get_source

Источник данных по ID. Только чтение. Возвращает: объект { id, name, type, enabled, lastSyncAt, config }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "sourceId": {
      "type": "string",
      "description": "ID источника"
    }
  },
  "required": [
    "sourceId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

import_cloud_spreadsheet

Импортировать данные из файла во внешнем облаке (provider) в существующий реестр. Для создания нового реестра из файла — create_registry_from_spreadsheet. Возвращает: текст с числом импортированных записей.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "enum": [
        "google_drive",
        "dropbox"
      ],
      "description": "Облачное хранилище"
    },
    "fileId": {
      "type": "string",
      "description": "ID файла (Google Drive) или путь к файлу (Dropbox)"
    },
    "registryId": {
      "type": "string",
      "description": "ID реестра для импорта"
    },
    "fieldMapping": {
      "description": "Маппинг колонок: {колонка_в_файле: имя_поля_реестра}",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "required": [
    "provider",
    "fileId",
    "registryId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

list_folders

Список папок реестров. Только чтение. Возвращает: массив { id, name, dropboxPath } или текст «Папки не найдены».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {},
  "$schema": "http://json-schema.org/draft-07/schema#"
}

list_records

Записи реестра постранично. Только чтение. Поиск по тексту — search_records; одна запись — get_record. Если total больше числа возвращённых записей — запроси следующие страницы (page=2, 3, …). Возвращает: { records: [{ id, typeId, data, createdAt, updatedAt }], total, page, limit } или текст «Записи не найдены».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "page": {
      "description": "Номер страницы, с 1 (по умолчанию 1)",
      "type": "number"
    },
    "limit": {
      "description": "Записей на страницу (по умолчанию 50, максимум 200)",
      "type": "number"
    }
  },
  "required": [
    "registryId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

list_registries

Список всех реестров команды. Только чтение. Для одного реестра со схемой полей — get_registry; для записей — list_records. Возвращает: { registries: [{ id, name, description }] } или текст «Реестры не найдены».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {},
  "$schema": "http://json-schema.org/draft-07/schema#"
}

list_registries_in_folder

Реестры внутри папки. Только чтение. Возвращает: массив { id, name, description } или текст «Реестры в папке не найдены».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "folderId": {
      "type": "string",
      "description": "ID папки"
    }
  },
  "required": [
    "folderId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

list_sources

Источники данных реестра. Только чтение. Один источник — get_source. Возвращает: массив { id, name, type, enabled, lastSyncAt, config } или текст «Источники не найдены».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    }
  },
  "required": [
    "registryId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

move_registry_to_folder

Переместить реестр в папку (пустой folderId — в корень). Возвращает: текст «Реестр перемещён».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "folderId": {
      "type": "string",
      "description": "ID папки (пустая строка для перемещения в корень)"
    }
  },
  "required": [
    "registryId",
    "folderId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

search_records

Поиск записей реестра по тексту, опционально по конкретным полям. Возвращает: { records, total } или текст «Записи не найдены».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "query": {
      "type": "string",
      "description": "Поисковый запрос"
    },
    "fields": {
      "description": "Ключи полей для поиска (по умолчанию все поля)",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "limit": {
      "description": "Максимум результатов (по умолчанию 50, максимум 200)",
      "type": "number"
    }
  },
  "required": [
    "registryId",
    "query"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

sync_folder_to_dropbox

⚠ Outward-facing: выгружает все реестры папки во внешний Dropbox как XLSX (создаёт/заменяет файлы). Путь берётся из dropboxPath или из настроек папки. Возвращает: текст с числом синхронизированных и статусами.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "folderId": {
      "type": "string",
      "description": "ID папки реестров"
    },
    "dropboxPath": {
      "description": "Путь в Dropbox (если не указан, берётся из настроек папки)",
      "type": "string"
    }
  },
  "required": [
    "folderId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

sync_records

Массовая синхронизация записей по ключу источника: добавляет/обновляет/удаляет. ⚠ При deleteRemoved=true записи реестра, отсутствующие во входном массиве, удаляются. Возвращает: объект { created, updated, deleted, unchanged }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "records": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Данные записи"
          },
          "sourceRowKey": {
            "type": "string",
            "description": "Уникальный ключ строки из источника"
          },
          "sourceRowHash": {
            "description": "Хеш строки для определения изменений",
            "type": "string"
          }
        },
        "required": [
          "data",
          "sourceRowKey"
        ]
      },
      "description": "Массив записей для синхронизации"
    },
    "addNew": {
      "description": "Добавлять новые записи (по умолчанию true)",
      "type": "boolean"
    },
    "updateExisting": {
      "description": "Обновлять существующие (по умолчанию true)",
      "type": "boolean"
    },
    "deleteRemoved": {
      "description": "Удалять отсутствующие (по умолчанию false)",
      "type": "boolean"
    }
  },
  "required": [
    "registryId",
    "records"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

sync_source

Запустить синхронизацию источника данных в реестр. Возвращает: объект с результатом синхронизации или текст «Ошибка синхронизации».

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "sourceId": {
      "type": "string",
      "description": "ID источника"
    }
  },
  "required": [
    "sourceId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

update_folder

Изменить папку реестров: название, путь Dropbox. Возвращает: текст-подтверждение с названием папки.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "folderId": {
      "type": "string",
      "description": "ID папки"
    },
    "name": {
      "description": "Новое название",
      "type": "string"
    },
    "dropboxPath": {
      "description": "Новый путь в Dropbox",
      "type": "string"
    }
  },
  "required": [
    "folderId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

update_record

Изменить данные записи реестра. Переданные ключи мержатся с существующими: непереданные поля сохраняются. Возвращает: объект обновлённой записи { id, typeId, data, createdAt, updatedAt }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "recordId": {
      "type": "string",
      "description": "ID записи"
    },
    "data": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {},
      "description": "Изменяемые поля: ключ поля → новое значение"
    }
  },
  "required": [
    "registryId",
    "recordId",
    "data"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

update_registry

Изменить реестр: название, описание, состав полей, триггеры. ⚠ fields заменяет ВЕСЬ набор полей: сначала вызови get_registry и передай все поля с их id и key, меняя только нужное. Поле без id создаётся заново; поле, отсутствующее в списке, удаляется вместе с данными записей. Для изменения одного поля (тип, название) используй update_registry_field — это безопаснее. Возвращает: текст-подтверждение с названием реестра.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "name": {
      "description": "Новое название",
      "type": "string"
    },
    "description": {
      "description": "Новое описание",
      "type": "string"
    },
    "fields": {
      "description": "Полный набор полей реестра (из get_registry, с правками)",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "ID существующего поля из get_registry; без id поле создаётся заново",
            "type": "string"
          },
          "key": {
            "description": "Системный ключ поля — данные записей хранятся под ним, не меняй без необходимости",
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Отображаемое название поля"
          },
          "dataType": {
            "description": "Тип поля: text, number, date, select, email, phone",
            "type": "string"
          },
          "required": {
            "description": "Обязательность заполнения поля",
            "type": "boolean"
          },
          "options": {
            "description": "Настройки поля; для select: { \"items\": [\"Вариант 1\", \"Вариант 2\"] }",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "name"
        ]
      }
    },
    "triggers": {
      "description": "Полный набор триггеров: заменяет существующие целиком — сначала получи текущие через get_registry",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "ID триггера из get_registry (при создании генерируется)",
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Название триггера"
          },
          "type": {
            "type": "string",
            "enum": [
              "event",
              "date"
            ],
            "description": "event — по событию записи, date — по полю-дате"
          },
          "event": {
            "description": "Событие (для type=event)",
            "type": "string",
            "enum": [
              "onCreate",
              "onUpdate",
              "onDelete"
            ]
          },
          "dateField": {
            "description": "Ключ поля-даты (для type=date)",
            "type": "string"
          },
          "reminders": {
            "description": "Напоминания (для type=date)",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "daysBefore": {
                  "type": "number",
                  "description": "За сколько дней до даты"
                },
                "time": {
                  "type": "string",
                  "description": "Время срабатывания HH:MM"
                },
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "daysBefore",
                "time"
              ]
            }
          },
          "action": {
            "type": "string",
            "const": "telegram",
            "description": "Действие"
          },
          "enabled": {
            "description": "Включён (по умолчанию true)",
            "type": "boolean"
          },
          "config": {
            "type": "object",
            "properties": {
              "recipients": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "userId": {
                      "type": "string"
                    },
                    "userName": {
                      "type": "string"
                    },
                    "telegramUsername": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "userId",
                    "userName"
                  ]
                },
                "description": "Получатели (userId и имя из list_users)"
              },
              "template": {
                "type": "string",
                "description": "Шаблон сообщения; поддерживает {{registryName}} и {{fields}}"
              },
              "fields": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Ключи полей, включаемых в сообщение"
              },
              "chatId": {
                "type": "string"
              }
            },
            "required": [
              "recipients",
              "template",
              "fields"
            ],
            "description": "Настройки действия"
          }
        },
        "required": [
          "name",
          "type",
          "action",
          "config"
        ]
      }
    }
  },
  "required": [
    "registryId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

update_registry_field

Изменить одно поле реестра: отображаемое название, тип, обязательность, настройки. Ключ поля, остальные поля и данные записей сохраняются как есть. Смена типа не конвертирует значения в записях — при необходимости обнови их отдельно через update_record (для date формат YYYY-MM-DD). Возвращает: текст-подтверждение с новым состоянием поля.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "registryId": {
      "type": "string",
      "description": "ID реестра"
    },
    "fieldKey": {
      "type": "string",
      "description": "Ключ поля (key из get_registry)"
    },
    "name": {
      "description": "Новое отображаемое название",
      "type": "string"
    },
    "dataType": {
      "description": "Новый тип: text, number, date, select, email, phone",
      "type": "string"
    },
    "required": {
      "description": "Обязательность заполнения поля",
      "type": "boolean"
    },
    "options": {
      "description": "Настройки поля; для select: { \"items\": [\"Вариант 1\", \"Вариант 2\"] }",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    }
  },
  "required": [
    "registryId",
    "fieldKey"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

update_source

Изменить источник данных: название, конфигурацию, вкл/выкл. Возвращает: текст-подтверждение с названием источника.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "sourceId": {
      "type": "string",
      "description": "ID источника"
    },
    "name": {
      "description": "Новое название",
      "type": "string"
    },
    "config": {
      "description": "Новая конфигурация",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "enabled": {
      "description": "Включён/выключен",
      "type": "boolean"
    }
  },
  "required": [
    "sourceId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

На этой странице