Перейти к содержимому
LegalStack

Базы знаний

Инструменты раздела «Базы знаний»: 16

Подключение: https://mcp.legalstack.ru/mcp/knowledge или в составе общего подключения https://mcp.legalstack.ru/mcp.

Добавить источник в базу знаний

add_knowledge_source · изменяет данные

Описание для модели: Add a text, a web page or a file to a knowledge base. Pass exactly one of text, url and path. A file is a PDF, DOCX, XLSX, TXT, MD or CSV from the working folder. Indexing goes on in the background, wait for it with get_knowledge_source.

Параметры

ПараметрТипОбязательныйОписание
knowledge_base_idstringдаKnowledge base id. Длина: 1–64.
namestringнетName of the source, required for a text. Длина: 1–255.
textstringнетText to index. Длина: 1–2000000.
urlstringнетHTTPS address of a page to index. Длина: 8–2000.
pathstringнетPath of a file in the working folder. Длина: 1–1000.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "knowledge_base_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Knowledge base id"
    },
    "name": {
      "description": "Name of the source, required for a text",
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "text": {
      "description": "Text to index",
      "type": "string",
      "minLength": 1,
      "maxLength": 2000000
    },
    "url": {
      "description": "HTTPS address of a page to index",
      "type": "string",
      "minLength": 8,
      "maxLength": 2000
    },
    "path": {
      "description": "Path of a file in the working folder",
      "type": "string",
      "minLength": 1,
      "maxLength": 1000
    }
  },
  "required": [
    "knowledge_base_id"
  ],
  "additionalProperties": false
}

Создать базу знаний

create_knowledge_base · изменяет данные

Описание для модели: Create a knowledge base of the team. Sources are added afterwards with add_knowledge_source.

Параметры

ПараметрТипОбязательныйОписание
namestringдаName of the base. Длина: 1–255.
descriptionstringнетWhat the base keeps and what for. Длина: до 2000.
folder_idstringнетFolder of the base, the root by default. Длина: 1–64.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Name of the base"
    },
    "description": {
      "description": "What the base keeps and what for",
      "type": "string",
      "maxLength": 2000
    },
    "folder_id": {
      "description": "Folder of the base, the root by default",
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}

Удалить базу знаний

delete_knowledge_base · необратимое действие

Описание для модели: Delete a knowledge base with all its sources. Cannot be restored.

Параметры

ПараметрТипОбязательныйОписание
knowledge_base_idstringдаKnowledge base id. Длина: 1–64.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "knowledge_base_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Knowledge base id"
    }
  },
  "required": [
    "knowledge_base_id"
  ],
  "additionalProperties": false
}

Удалить источник из базы знаний

delete_knowledge_source · необратимое действие

Описание для модели: Delete a source from a knowledge base. Cannot be restored.

Параметры

ПараметрТипОбязательныйОписание
source_idstringдаSource id. Длина: 1–64.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "source_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Source id"
    }
  },
  "required": [
    "source_id"
  ],
  "additionalProperties": false
}

Оглавление источника

get_knowledge_outline · только чтение

Описание для модели: Get the outline of a source: chapters, articles and clauses. Use to find the needed part of a long document before read_knowledge_source.

Параметры

ПараметрТипОбязательныйОписание
source_idstringдаSource id. Длина: 1–64.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "source_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Source id"
    }
  },
  "required": [
    "source_id"
  ],
  "additionalProperties": false
}

Карточка источника

get_knowledge_source · только чтение

Описание для модели: Get a source or a legal act with details and indexing status. With wait_seconds waits until indexing of a fresh source ends.

Параметры

ПараметрТипОбязательныйОписание
source_idstringдаSource id. Длина: 1–64.
wait_secondsintegerнетSeconds to wait for indexing to end, does not wait by default. По умолчанию: 0. Диапазон: 0–240.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "source_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Source id"
    },
    "wait_seconds": {
      "default": 0,
      "description": "Seconds to wait for indexing to end, does not wait by default",
      "type": "integer",
      "minimum": 0,
      "maximum": 240
    }
  },
  "required": [
    "source_id"
  ],
  "additionalProperties": false
}

Кто ссылается на источник

list_knowledge_backlinks · только чтение

Описание для модели: List documents that refer to a source or to one part of it.

Параметры

ПараметрТипОбязательныйОписание
source_idstringдаSource id. Длина: 1–64.
part_idstringнетNarrow to references to this part. Длина: 1–64.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "source_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Source id"
    },
    "part_id": {
      "description": "Narrow to references to this part",
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    }
  },
  "required": [
    "source_id"
  ],
  "additionalProperties": false
}

Базы знаний команды

list_knowledge_bases · только чтение

Описание для модели: List knowledge bases of the team. A base is a collection of sources. writable tells whether the current user may add to the base.

Параметры

Параметров нет.

JSON Schema параметров
{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

Ссылки источника на акты

list_knowledge_citations · только чтение

Описание для модели: List references from a source to laws and court acts.

Параметры

ПараметрТипОбязательныйОписание
source_idstringдаSource id. Длина: 1–64.
from_numberintegerнетNumber of the first part, with to_number. Диапазон: 0–9007199254740991.
to_numberintegerнетNumber of the last part, with from_number. Диапазон: 0–9007199254740991.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "source_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Source id"
    },
    "from_number": {
      "description": "Number of the first part, with to_number",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "to_number": {
      "description": "Number of the last part, with from_number",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "source_id"
  ],
  "additionalProperties": false
}

Источники базы знаний

list_knowledge_sources · только чтение

Описание для модели: List sources of a knowledge base with indexing status.

Параметры

ПараметрТипОбязательныйОписание
knowledge_base_idstringдаKnowledge base id. Длина: 1–64.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "knowledge_base_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Knowledge base id"
    }
  },
  "required": [
    "knowledge_base_id"
  ],
  "additionalProperties": false
}

Правовая база платформы

list_legal_acts · только чтение

Описание для модели: List laws and court acts of the legal base of the platform. Gives ids of acts for reading, exact links and narrowing search_knowledge.

Параметры

ПараметрТипОбязательныйОписание
kindstringнетKind of the act. Значения: Конституция, Международный акт, Федеральный конституционный закон, Кодекс, Федеральный закон, Акт Президента, Акт Правительства, Ведомственный акт, Региональный акт, Муниципальный акт, Постановление Пленума ВС, Обзор практики ВС, Определение ВС, Постановление КС, Акт арбитражного суда, Акт суда общей юрисдикции, Договор, Справочный материал, Комментарий, Не определён.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "Конституция",
        "Международный акт",
        "Федеральный конституционный закон",
        "Кодекс",
        "Федеральный закон",
        "Акт Президента",
        "Акт Правительства",
        "Ведомственный акт",
        "Региональный акт",
        "Муниципальный акт",
        "Постановление Пленума ВС",
        "Обзор практики ВС",
        "Определение ВС",
        "Постановление КС",
        "Акт арбитражного суда",
        "Акт суда общей юрисдикции",
        "Договор",
        "Справочный материал",
        "Комментарий",
        "Не определён"
      ],
      "description": "Kind of the act"
    }
  },
  "additionalProperties": false
}

Прочитать источник

read_knowledge_source · только чтение

Описание для модели: Read the text of a source in order or one part of it. With part_id returns that part in full for exact quoting, otherwise parts in order from the given number. Cite a norm as a markdown link whose address is the link of the result, the link stays valid when the base is updated.

Параметры

ПараметрТипОбязательныйОписание
source_idstringдаSource id. Длина: 1–64.
part_idstringнетPart to read in full, from search or the outline. Длина: 1–64.
from_numberintegerнетNumber of the first part to read. По умолчанию: 0. Диапазон: 0–9007199254740991.
limitintegerнетMaximum number of items to return, 10 by default. По умолчанию: 10. Диапазон: 1–50.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "source_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Source id"
    },
    "part_id": {
      "description": "Part to read in full, from search or the outline",
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "from_number": {
      "default": 0,
      "description": "Number of the first part to read",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of items to return, 10 by default",
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    }
  },
  "required": [
    "source_id"
  ],
  "additionalProperties": false
}

Переиндексировать источник

reindex_knowledge_source · изменяет данные

Описание для модели: Index a source of a knowledge base again after a failure. Indexing goes on in the background, wait for it with get_knowledge_source.

Параметры

ПараметрТипОбязательныйОписание
source_idstringдаSource id. Длина: 1–64.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "source_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Source id"
    }
  },
  "required": [
    "source_id"
  ],
  "additionalProperties": false
}

Запомнить для команды

save_knowledge_note · изменяет данные

Описание для модели: Save a note to a knowledge base shared with colleagues. For notes the user wants colleagues to see, a note only for the user goes to the own memory of the agent. Without knowledge_base_id the only writable base is used, with several writable bases ask the user which one.

Параметры

ПараметрТипОбязательныйОписание
titlestringдаShort name of the note. Длина: 1–255.
notestringдаText of the note in the words of the user. Длина: 1–20000.
knowledge_base_idstringнетWritable base from list_knowledge_bases. Длина: 1–64.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Short name of the note"
    },
    "note": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20000,
      "description": "Text of the note in the words of the user"
    },
    "knowledge_base_id": {
      "description": "Writable base from list_knowledge_bases",
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    }
  },
  "required": [
    "title",
    "note"
  ],
  "additionalProperties": false
}

Поиск по базам знаний

search_knowledge · только чтение

Описание для модели: Search laws, court practice and team documents by meaning. Use for questions about law and the content of documents. A cut text is read in full with read_knowledge_source. Cite a norm as a markdown link whose address is the link of the result, the link stays valid when the base is updated.

Параметры

ПараметрТипОбязательныйОписание
querystringдаQuestion or phrase in natural language. Длина: 1–2000.
scopestringнетWhere to search, everywhere by default. Значения: Везде, Базы команды, Правовая база.
knowledge_base_idsмассив stringнетBases of the team to search. Элементов: до 50.
legal_act_idsмассив stringнетActs from list_legal_acts to search. Элементов: до 50.
limitintegerнетMaximum number of items to return, 10 by default. По умолчанию: 10. Диапазон: 1–50.
graph_depthintegerнетHow far to follow links between documents. По умолчанию: 1. Диапазон: 0–3.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000,
      "description": "Question or phrase in natural language"
    },
    "scope": {
      "type": "string",
      "enum": [
        "Везде",
        "Базы команды",
        "Правовая база"
      ],
      "description": "Where to search, everywhere by default"
    },
    "knowledge_base_ids": {
      "description": "Bases of the team to search",
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Knowledge base id"
      }
    },
    "legal_act_ids": {
      "description": "Acts from list_legal_acts to search",
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Legal act id"
      }
    },
    "limit": {
      "default": 10,
      "description": "Maximum number of items to return, 10 by default",
      "type": "integer",
      "minimum": 1,
      "maximum": 50
    },
    "graph_depth": {
      "default": 1,
      "description": "How far to follow links between documents",
      "type": "integer",
      "minimum": 0,
      "maximum": 3
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false
}

Изменить базу знаний

update_knowledge_base · изменяет данные

Описание для модели: Rename a knowledge base or change its description.

Параметры

ПараметрТипОбязательныйОписание
knowledge_base_idstringдаKnowledge base id. Длина: 1–64.
namestringнетNew name. Длина: 1–255.
descriptionstringнетNew description, an empty text removes it. Длина: до 2000.
JSON Schema параметров
{
  "type": "object",
  "properties": {
    "knowledge_base_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "Knowledge base id"
    },
    "name": {
      "description": "New name",
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "description": "New description, an empty text removes it",
      "type": "string",
      "maxLength": 2000
    }
  },
  "required": [
    "knowledge_base_id"
  ],
  "additionalProperties": false
}

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