LegalStack
MCP

Documents

Документы и смартдоки: создание, правка, экспорт, секции

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

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

convert_file

Конвертировать файл между форматами. Поддержка: xlsx→csv, csv→xlsx, csv/json/txt/md→pdf. В workspace возвращает filePath, иначе contentBase64. Возвращает: { fileName, sizeKB, filePath | contentBase64 }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "contentBase64": {
      "type": "string",
      "description": "Содержимое исходного файла в base64"
    },
    "fileName": {
      "type": "string",
      "description": "Имя исходного файла (например data.xlsx)"
    },
    "toFormat": {
      "type": "string",
      "description": "Целевой формат (csv, xlsx, pdf)"
    }
  },
  "required": [
    "contentBase64",
    "fileName",
    "toFormat"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

copy_document

Создать копию документа со всеми блоками. Возвращает: { documentId, id, sourceDocumentId, title, folderId } новой копии.

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

create_block

Создать блок в документе. Перед вызовом узнай переменные через get_block_schema. Возвращает: { blockId, label, type, order, depth, template, variablesJson, renderAs }. Если в документе включён режим предложений, блок не создаётся сразу — возвращается suggested: true и предложение ждёт решения пользователя в редакторе; blockId станет реальным после принятия.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "documentId": {
      "type": "string",
      "description": "ID документа"
    },
    "type": {
      "type": "string",
      "description": "Тип блока"
    },
    "label": {
      "type": "string",
      "description": "Метка блока"
    },
    "order": {
      "type": "number",
      "description": "Порядок блока"
    },
    "depth": {
      "description": "Глубина вложенности",
      "type": "number"
    },
    "template": {
      "description": "Шаблон: текст и переменные {key}. Выделение — инлайн-теги <b>/<i>/<u>, ссылки <a href=\"\">. Переменные только через {key}, HTML-чипы не вписывай.",
      "type": "string"
    },
    "variables": {
      "description": "Значения переменных",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    }
  },
  "required": [
    "documentId",
    "type",
    "label",
    "order"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

create_csv

Сгенерировать CSV-файл из произвольных данных. В workspace возвращает filePath, иначе contentBase64. Возвращает: { fileName, sizeKB, filePath | contentBase64 }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "fileName": {
      "type": "string",
      "description": "Имя файла (например data.csv)"
    },
    "columns": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Заголовки столбцов"
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "description": "Строки данных"
    },
    "separator": {
      "description": "Разделитель (по умолчанию запятая)",
      "type": "string",
      "enum": [
        ",",
        ";"
      ]
    }
  },
  "required": [
    "fileName",
    "columns",
    "rows"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

create_document

Создать новый пустой документ. Блоки добавляй по одному через create_block — каждый сразу виден в открытом редакторе. Для импорта — import_html/import_file. Возвращает: { documentId, id, title, folderId }.

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

create_docx

Сгенерировать Word-файл (DOCX) из секций: заголовки, параграфы, таблицы. В workspace возвращает filePath, иначе contentBase64. Возвращает: { fileName, sizeKB, filePath | contentBase64 }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "fileName": {
      "type": "string",
      "description": "Имя файла (например report.docx)"
    },
    "title": {
      "description": "Заголовок документа",
      "type": "string"
    },
    "sections": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "heading",
              "paragraph",
              "table"
            ],
            "description": "Тип секции"
          },
          "level": {
            "description": "Уровень заголовка (1-4, только для heading)",
            "type": "number"
          },
          "text": {
            "description": "Текст (для heading и paragraph)",
            "type": "string"
          },
          "bold": {
            "description": "Жирный текст (для paragraph)",
            "type": "boolean"
          },
          "headers": {
            "description": "Заголовки таблицы (для table)",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "description": "Строки таблицы (для table)",
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "type"
        ]
      },
      "description": "Секции документа"
    }
  },
  "required": [
    "fileName",
    "sections"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

create_folder

Создать папку (опционально вложенную в parentId). Возвращает: { folderId, name, message }.

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

create_from_template

Создать документ из документа-шаблона. templateId — id шаблона: из системной библиотеки (list_library_templates) или из своих документов-шаблонов (list_documents, status=template). Опции: registryRecordId — заполнить/привязать к записи реестра; parentDocId + kind (act/addendum/appendix/protocol) — создать связанный дочерний документ. Шаблон копируется со всеми блоками. Возвращает: { documentId, id, title, folderId } — затем открой через navigate.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "templateId": {
      "type": "string",
      "description": "ID документа-шаблона"
    },
    "registryRecordId": {
      "description": "ID записи реестра для привязки/заполнения",
      "type": "string"
    },
    "parentBlockId": {
      "description": "ID родительского блока (контекст вставки)",
      "type": "string"
    },
    "parentDocId": {
      "description": "ID родительского документа (для связанного дочернего)",
      "type": "string"
    },
    "kind": {
      "description": "Тип связанного документа (нужен parentDocId)",
      "type": "string",
      "enum": [
        "act",
        "addendum",
        "appendix",
        "protocol"
      ]
    }
  },
  "required": [
    "templateId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

create_json_file

Сгенерировать JSON-файл из произвольных данных. В workspace возвращает filePath, иначе contentBase64. Возвращает: { fileName, sizeKB, filePath | contentBase64 }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "fileName": {
      "type": "string",
      "description": "Имя файла (например data.json)"
    },
    "data": {
      "description": "Данные для сериализации в JSON"
    }
  },
  "required": [
    "fileName",
    "data"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

Привязать запись реестра к документу. Маппинг полей реестра на переменные документа — автоматически по совпадению ключей. Возвращает: { linkId, message }.

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

create_pdf

Сгенерировать PDF-файл из секций: заголовки, параграфы, таблицы. В workspace возвращает filePath, иначе contentBase64. Возвращает: { fileName, sizeKB, filePath | contentBase64 }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "fileName": {
      "type": "string",
      "description": "Имя файла (например report.pdf)"
    },
    "title": {
      "description": "Заголовок документа",
      "type": "string"
    },
    "sections": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "heading",
              "paragraph",
              "table"
            ],
            "description": "Тип секции"
          },
          "level": {
            "description": "Уровень заголовка (1-4, только для heading)",
            "type": "number"
          },
          "text": {
            "description": "Текст (для heading и paragraph)",
            "type": "string"
          },
          "bold": {
            "description": "Жирный текст (для paragraph)",
            "type": "boolean"
          },
          "headers": {
            "description": "Заголовки таблицы (для table)",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "description": "Строки таблицы (для table)",
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "type"
        ]
      },
      "description": "Секции документа"
    }
  },
  "required": [
    "fileName",
    "sections"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

create_text_file

Сгенерировать текстовый файл; формат берётся из расширения в fileName (txt/md/html). В workspace возвращает filePath, иначе contentBase64. Возвращает: { fileName, sizeKB, filePath | contentBase64 }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "fileName": {
      "type": "string",
      "description": "Имя файла (например notes.txt, report.md, page.html)"
    },
    "content": {
      "type": "string",
      "description": "Текстовое содержимое файла"
    }
  },
  "required": [
    "fileName",
    "content"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

create_version

Сохранить версию (снимок) текущего состояния документа. Возвращает: { versionId }.

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

create_xlsx

Сгенерировать Excel-файл (XLSX) из произвольных данных, несколько листов. В workspace возвращает filePath, иначе contentBase64. Возвращает: { fileName, sizeKB, filePath | contentBase64 }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "fileName": {
      "type": "string",
      "description": "Имя файла (например report.xlsx)"
    },
    "sheets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Название листа"
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "header": {
                  "type": "string",
                  "description": "Заголовок столбца"
                },
                "key": {
                  "type": "string",
                  "description": "Ключ для данных"
                },
                "width": {
                  "description": "Ширина столбца",
                  "type": "number"
                }
              },
              "required": [
                "header",
                "key"
              ]
            },
            "description": "Столбцы"
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            },
            "description": "Строки данных (ключи = key из columns)"
          }
        },
        "required": [
          "name",
          "columns",
          "rows"
        ]
      },
      "description": "Листы с данными"
    }
  },
  "required": [
    "fileName",
    "sheets"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

delete_block

⚠ Необратимо удаляет блок из документа. Восстановления нет. Возвращает: { documentId, blockId, deleted: true }. Если в документе включён режим предложений, блок не удаляется сразу — возвращается suggested: true (deleted: false) и предложение ждёт решения пользователя в редакторе.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "documentId": {
      "type": "string",
      "description": "ID документа"
    },
    "blockId": {
      "type": "string",
      "description": "ID блока"
    }
  },
  "required": [
    "documentId",
    "blockId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

delete_document

⚠ Необратимо удаляет документ со всеми блоками и связями. Восстановления нет. Для копии перед удалением — copy_document; снимок — create_version. Возвращает: { documentId, deleted: true }.

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

delete_folder

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

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

⚠ Удаляет связь документа с записью реестра. Сама запись реестра и документ остаются. Возвращает: { linkId, deleted: true }.

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

dropbox_create_folder

⚠ Outward-facing: создаёт папку во внешнем Dropbox. Возвращает: { pathDisplay, message }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "path": {
      "type": "string",
      "description": "Полный путь папки (например /Documents/Contracts/2026)"
    }
  },
  "required": [
    "path"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

dropbox_delete

⚠ Outward-facing и необратимо: удаляет файл или папку во внешнем Dropbox. Возвращает: { pathDisplay, tag }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "path": {
      "type": "string",
      "description": "Полный путь к файлу или папке"
    }
  },
  "required": [
    "path"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

dropbox_download

Скачать файл из внешнего Dropbox. В workspace возвращает filePath, иначе contentBase64. Возвращает: { fileName, sizeKB, filePath | contentBase64 }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "path": {
      "type": "string",
      "description": "Путь к файлу в Dropbox"
    }
  },
  "required": [
    "path"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

dropbox_move

⚠ Outward-facing: перемещает или переименовывает файл/папку во внешнем Dropbox. Возвращает: { pathDisplay, message }.

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

dropbox_upload_file

⚠ Outward-facing: загружает файл (base64) во внешний Dropbox. Возвращает: { pathDisplay, sizeKB, message }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "path": {
      "type": "string",
      "description": "Полный путь в Dropbox (например /Documents/report.pdf)"
    },
    "contentBase64": {
      "type": "string",
      "description": "Содержимое файла в base64"
    },
    "mode": {
      "description": "Режим: add (по умолчанию) или overwrite",
      "type": "string",
      "enum": [
        "add",
        "overwrite"
      ]
    }
  },
  "required": [
    "path",
    "contentBase64"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

export_document_to_cloud

⚠ Outward-facing: конвертирует документ в выбранный формат и загружает во внешнее облако (provider). Возвращает: { provider, fileName, sizeKB, message }.

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

generate_document_file

Сгенерировать файл (PDF или DOCX) из документа LegalStack. В workspace возвращает filePath, иначе contentBase64. Для выгрузки в облако — export_document_to_cloud. Возвращает: { fileName, format, sizeKB, filePath | contentBase64 }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "documentId": {
      "type": "string",
      "description": "ID документа"
    },
    "format": {
      "type": "string",
      "enum": [
        "pdf",
        "docx"
      ],
      "description": "Формат файла"
    }
  },
  "required": [
    "documentId",
    "format"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

get_block_schema

Переменные и значения по умолчанию для типа блока. Только чтение. Второй шаг сборки: вызови после list_block_types и перед create_block. Возвращает: { schema } (переменные, дефолты).

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "blockType": {
      "type": "string",
      "description": "Тип блока (получи список через list_block_types)"
    }
  },
  "required": [
    "blockType"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

get_contract_roles

Роли сторон для типа договора. Только чтение. Возвращает: { roles }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "contractType": {
      "description": "Тип договора",
      "type": "string"
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}

get_dependent_documents

Документы, связанные с записью реестра (обратный поиск к get_document_links). Только чтение. Возвращает: { documents }.

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

get_document

Полный документ с блоками по ID. Только чтение. ID берётся из list_documents. Возвращает: { document } со списком блоков.

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

Связи документа с записями реестров. Только чтение. Создать связь — create_link; удалить — delete_link; обратный поиск — get_dependent_documents. Возвращает: { links }.

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

get_document_types

Справочник типов документов. Только чтение. Возвращает: { documentTypes }.

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

get_folder

Папка по ID. Только чтение. Возвращает: { folder }.

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

get_import_status

Статус задачи импорта файла по jobId (из import_file). Только чтение. Возвращает: { id, documentId, status, progress, error }.

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

get_versions

История версий документа. Только чтение. Возвращает: { versions: [{ id, comment, createdAt }] }.

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

google_drive_upload_file

⚠ Outward-facing: загружает файл (base64) во внешний Google Drive. Возвращает: { name, id, webViewLink, message }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "fileName": {
      "type": "string",
      "description": "Имя файла (например report.pdf)"
    },
    "contentBase64": {
      "type": "string",
      "description": "Содержимое файла в base64"
    },
    "mimeType": {
      "description": "MIME-тип (например application/pdf). По умолчанию application/octet-stream",
      "type": "string"
    },
    "folderId": {
      "description": "ID папки в Google Drive",
      "type": "string"
    }
  },
  "required": [
    "fileName",
    "contentBase64"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

import_cloud_document

Импортировать документ из облака (provider) в LegalStack. Возвращает: { documentId, message }.

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

import_file

Импортировать файл PDF или DOCX в новый документ (асинхронно). Прогресс отслеживай через get_import_status по jobId. Возвращает: { jobId, documentId, status, progress }.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "filename": {
      "type": "string",
      "description": "Имя файла"
    },
    "fileBase64": {
      "type": "string",
      "description": "Содержимое файла в base64"
    },
    "folderId": {
      "description": "ID папки",
      "type": "string"
    }
  },
  "required": [
    "filename",
    "fileBase64"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

import_html

Импортировать HTML в новый документ. Возвращает: { documentId, id, title, folderId }.

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

list_block_types

Доступные типы блоков с числом переменных. Только чтение. Первый шаг сборки документа: list_block_types → get_block_schema → create_block. Возвращает: { blockTypes }.

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

list_cloud_files

Файлы-документы из подключённого облака (provider). Только чтение. Возвращает: { files, hasMore?, cursor? } или { message }.

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

list_documents

Список документов команды, опционально по папке. Только чтение. Для одного документа с блоками — get_document; для папок — list_folders. Возвращает: { documents: [{ id, title, status, updatedAt }] } или { message }.

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

list_folders

Список папок документов. Только чтение. Возвращает: { folders: [{ id, name, parentId }] } или { message }.

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

list_library_templates

Системная библиотека готовых шаблонов документов (курируемый каталог). Только чтение. Выбери подходящий и создай документ через create_from_template(templateId). Возвращает: { templates: [{ id, name, documentKind, documentSubtype, practiceAreas }] }.

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

move_document

Переместить документ в другую папку (пустой folderId — в корень). Возвращает: { documentId, id, title, folderId }.

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

restore_version

⚠ Заменяет текущее содержимое документа состоянием из версии. Несохранённые изменения теряются. versionId берётся из get_versions. Возвращает: { documentId, title, restored: true }.

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

update_block

Изменить блок документа. Передавай только меняемые поля. Возвращает: { ...обновлённый блок }. Если в документе включён режим предложений, правка не применяется сразу — возвращается suggested: true и предложение ждёт решения пользователя в редакторе.

Параметры (JSON Schema)
{
  "type": "object",
  "properties": {
    "documentId": {
      "type": "string",
      "description": "ID документа"
    },
    "blockId": {
      "type": "string",
      "description": "ID блока"
    },
    "label": {
      "description": "Новая метка",
      "type": "string"
    },
    "order": {
      "description": "Новый порядок",
      "type": "number"
    },
    "depth": {
      "description": "Новая глубина",
      "type": "number"
    },
    "template": {
      "description": "Новый шаблон (текст + {key}; выделение <b>/<i>/<u>, ссылки <a href=\"\">)",
      "type": "string"
    },
    "variables": {
      "description": "Новые значения переменных",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    }
  },
  "required": [
    "documentId",
    "blockId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}

update_document

Изменить название, статус или папку документа. Передавай только меняемые поля. Возвращает: { documentId, id, title, status, folderId }.

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

update_folder

Изменить название или родителя папки. Передавай только меняемые поля. Возвращает: { folderId, name, message }.

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

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