chore: publish clean community baseline
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
# Примеры Dadata
|
||||
|
||||
В этой папке лежат примеры операций Crank для Dadata. Их можно импортировать в интерфейсе Crank и использовать как основу для MCP-инструментов.
|
||||
|
||||
Dadata не предоставляет эти методы полностью без ключей. Для работы нужны ключи из личного кабинета Dadata:
|
||||
|
||||
- `Authorization: Token <API_KEY>` нужен для всех примеров.
|
||||
- `X-Secret: <SECRET_KEY>` дополнительно нужен для методов стандартизации.
|
||||
|
||||
В YAML-файлах стоят заглушки `Token CHANGE_ME_DADATA_API_KEY` и `CHANGE_ME_DADATA_SECRET_KEY`. Перед использованием замените их в настройках операции на реальные значения. Не добавляйте ключи во входные параметры инструмента: тогда MCP-клиент и агент смогут их увидеть.
|
||||
|
||||
## Группа “Паспорта”
|
||||
|
||||
- `passports/dadata_clean_passport.operation.yaml` проверяет и разбирает номер паспорта через метод стандартизации.
|
||||
- `passports/dadata_suggest_fms_unit.operation.yaml` ищет подразделение ФМС/МВД по коду или названию.
|
||||
|
||||
## Группа “Автомобили”
|
||||
|
||||
- `cars/dadata_clean_vehicle.operation.yaml` распознает марку и модель автомобиля из свободного текста.
|
||||
- `cars/dadata_suggest_car_brand.operation.yaml` ищет марку автомобиля по русскому или английскому названию.
|
||||
|
||||
## Как проверить
|
||||
|
||||
1. Импортируйте нужный YAML-файл в Crank.
|
||||
2. Замените заголовки-заглушки на реальные ключи Dadata.
|
||||
3. Запустите тест операции в интерфейсе Crank.
|
||||
4. Создайте агента, привяжите к нему операции одной группы и опубликуйте агента.
|
||||
5. Подключите MCP-клиент к опубликованному агенту и вызовите нужный инструмент.
|
||||
|
||||
Документация Dadata:
|
||||
|
||||
- Проверка паспорта: https://dadata.ru/api/clean/passport/
|
||||
- Подразделения ФМС/МВД: https://dadata.ru/api/suggest/fms_unit/
|
||||
- Стандартизация автомобилей: https://dadata.ru/api/clean/vehicle/
|
||||
- Марки автомобилей: https://dadata.ru/api/suggest/car_brand/
|
||||
@@ -0,0 +1,91 @@
|
||||
format_version: "1"
|
||||
kind: operation
|
||||
operation:
|
||||
name: dadata_clean_vehicle
|
||||
display_name: Распознать автомобиль
|
||||
category: dadata_cars
|
||||
protocol: rest
|
||||
security_level: standard
|
||||
enabled: true
|
||||
status: draft
|
||||
version: 1
|
||||
target:
|
||||
kind: rest
|
||||
base_url: https://cleaner.dadata.ru
|
||||
method: POST
|
||||
path_template: /api/v1/clean/vehicle
|
||||
static_headers:
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
Authorization: Token CHANGE_ME_DADATA_API_KEY
|
||||
X-Secret: CHANGE_ME_DADATA_SECRET_KEY
|
||||
input_schema:
|
||||
type: object
|
||||
required: true
|
||||
fields:
|
||||
vehicle:
|
||||
type: string
|
||||
required: true
|
||||
output_schema:
|
||||
type: object
|
||||
required: true
|
||||
fields:
|
||||
source:
|
||||
type: string
|
||||
required: false
|
||||
result:
|
||||
type: string
|
||||
required: false
|
||||
brand:
|
||||
type: string
|
||||
required: false
|
||||
model:
|
||||
type: string
|
||||
required: false
|
||||
qc:
|
||||
type: integer
|
||||
required: true
|
||||
input_mapping:
|
||||
rules:
|
||||
- source: $.mcp.vehicle
|
||||
target: $.request.body[0]
|
||||
required: true
|
||||
output_mapping:
|
||||
rules:
|
||||
- source: $.response.body[0].source
|
||||
target: $.output.source
|
||||
required: false
|
||||
- source: $.response.body[0].result
|
||||
target: $.output.result
|
||||
required: false
|
||||
- source: $.response.body[0].brand
|
||||
target: $.output.brand
|
||||
required: false
|
||||
- source: $.response.body[0].model
|
||||
target: $.output.model
|
||||
required: false
|
||||
- source: $.response.body[0].qc
|
||||
target: $.output.qc
|
||||
required: true
|
||||
execution_config:
|
||||
timeout_ms: 10000
|
||||
retry_policy: null
|
||||
response_cache: null
|
||||
auth_profile_ref: null
|
||||
headers: {}
|
||||
protocol_options: null
|
||||
streaming: null
|
||||
tool_description:
|
||||
title: Распознать автомобиль
|
||||
description: Распознает марку и модель автомобиля из свободного текста через Dadata.
|
||||
tags:
|
||||
- dadata
|
||||
- vehicle
|
||||
- car
|
||||
- rest
|
||||
examples:
|
||||
- input:
|
||||
vehicle: форд фокус
|
||||
config_export:
|
||||
format_version: "1"
|
||||
export_mode: portable
|
||||
@@ -0,0 +1,92 @@
|
||||
format_version: "1"
|
||||
kind: operation
|
||||
operation:
|
||||
name: dadata_suggest_car_brand
|
||||
display_name: Найти марку автомобиля
|
||||
category: dadata_cars
|
||||
protocol: rest
|
||||
security_level: standard
|
||||
enabled: true
|
||||
status: draft
|
||||
version: 1
|
||||
target:
|
||||
kind: rest
|
||||
base_url: https://suggestions.dadata.ru
|
||||
method: POST
|
||||
path_template: /suggestions/api/4_1/rs/suggest/car_brand
|
||||
static_headers:
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
Authorization: Token CHANGE_ME_DADATA_API_KEY
|
||||
input_schema:
|
||||
type: object
|
||||
required: true
|
||||
fields:
|
||||
query:
|
||||
type: string
|
||||
required: true
|
||||
count:
|
||||
type: integer
|
||||
required: false
|
||||
output_schema:
|
||||
type: object
|
||||
required: true
|
||||
fields:
|
||||
value:
|
||||
type: string
|
||||
required: false
|
||||
id:
|
||||
type: string
|
||||
required: false
|
||||
name:
|
||||
type: string
|
||||
required: false
|
||||
name_ru:
|
||||
type: string
|
||||
required: false
|
||||
input_mapping:
|
||||
rules:
|
||||
- source: $.mcp.query
|
||||
target: $.request.body.query
|
||||
required: true
|
||||
- source: $.mcp.count
|
||||
target: $.request.body.count
|
||||
required: false
|
||||
default_value: 5
|
||||
output_mapping:
|
||||
rules:
|
||||
- source: $.response.body.suggestions[0].value
|
||||
target: $.output.value
|
||||
required: false
|
||||
- source: $.response.body.suggestions[0].data.id
|
||||
target: $.output.id
|
||||
required: false
|
||||
- source: $.response.body.suggestions[0].data.name
|
||||
target: $.output.name
|
||||
required: false
|
||||
- source: $.response.body.suggestions[0].data.name_ru
|
||||
target: $.output.name_ru
|
||||
required: false
|
||||
execution_config:
|
||||
timeout_ms: 10000
|
||||
retry_policy: null
|
||||
response_cache: null
|
||||
auth_profile_ref: null
|
||||
headers: {}
|
||||
protocol_options: null
|
||||
streaming: null
|
||||
tool_description:
|
||||
title: Найти марку автомобиля
|
||||
description: Ищет марку автомобиля в справочнике Dadata по русскому или английскому названию.
|
||||
tags:
|
||||
- dadata
|
||||
- vehicle
|
||||
- car
|
||||
- rest
|
||||
examples:
|
||||
- input:
|
||||
query: форд
|
||||
count: 5
|
||||
config_export:
|
||||
format_version: "1"
|
||||
export_mode: portable
|
||||
@@ -0,0 +1,84 @@
|
||||
format_version: "1"
|
||||
kind: operation
|
||||
operation:
|
||||
name: dadata_clean_passport
|
||||
display_name: Проверить паспорт
|
||||
category: dadata_passports
|
||||
protocol: rest
|
||||
security_level: standard
|
||||
enabled: true
|
||||
status: draft
|
||||
version: 1
|
||||
target:
|
||||
kind: rest
|
||||
base_url: https://cleaner.dadata.ru
|
||||
method: POST
|
||||
path_template: /api/v1/clean/passport
|
||||
static_headers:
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
Authorization: Token CHANGE_ME_DADATA_API_KEY
|
||||
X-Secret: CHANGE_ME_DADATA_SECRET_KEY
|
||||
input_schema:
|
||||
type: object
|
||||
required: true
|
||||
fields:
|
||||
passport:
|
||||
type: string
|
||||
required: true
|
||||
output_schema:
|
||||
type: object
|
||||
required: true
|
||||
fields:
|
||||
source:
|
||||
type: string
|
||||
required: false
|
||||
series:
|
||||
type: string
|
||||
required: false
|
||||
number:
|
||||
type: string
|
||||
required: false
|
||||
qc:
|
||||
type: integer
|
||||
required: true
|
||||
input_mapping:
|
||||
rules:
|
||||
- source: $.mcp.passport
|
||||
target: $.request.body[0]
|
||||
required: true
|
||||
output_mapping:
|
||||
rules:
|
||||
- source: $.response.body[0].source
|
||||
target: $.output.source
|
||||
required: false
|
||||
- source: $.response.body[0].series
|
||||
target: $.output.series
|
||||
required: false
|
||||
- source: $.response.body[0].number
|
||||
target: $.output.number
|
||||
required: false
|
||||
- source: $.response.body[0].qc
|
||||
target: $.output.qc
|
||||
required: true
|
||||
execution_config:
|
||||
timeout_ms: 10000
|
||||
retry_policy: null
|
||||
response_cache: null
|
||||
auth_profile_ref: null
|
||||
headers: {}
|
||||
protocol_options: null
|
||||
streaming: null
|
||||
tool_description:
|
||||
title: Проверить паспорт
|
||||
description: Проверяет формат и действительность паспорта по данным Dadata.
|
||||
tags:
|
||||
- dadata
|
||||
- passport
|
||||
- rest
|
||||
examples:
|
||||
- input:
|
||||
passport: "4509 235857"
|
||||
config_export:
|
||||
format_version: "1"
|
||||
export_mode: portable
|
||||
@@ -0,0 +1,98 @@
|
||||
format_version: "1"
|
||||
kind: operation
|
||||
operation:
|
||||
name: dadata_suggest_fms_unit
|
||||
display_name: Найти подразделение ФМС/МВД
|
||||
category: dadata_passports
|
||||
protocol: rest
|
||||
security_level: standard
|
||||
enabled: true
|
||||
status: draft
|
||||
version: 1
|
||||
target:
|
||||
kind: rest
|
||||
base_url: https://suggestions.dadata.ru
|
||||
method: POST
|
||||
path_template: /suggestions/api/4_1/rs/suggest/fms_unit
|
||||
static_headers:
|
||||
Content-Type: application/json
|
||||
Accept: application/json
|
||||
Authorization: Token CHANGE_ME_DADATA_API_KEY
|
||||
input_schema:
|
||||
type: object
|
||||
required: true
|
||||
fields:
|
||||
query:
|
||||
type: string
|
||||
required: true
|
||||
count:
|
||||
type: integer
|
||||
required: false
|
||||
output_schema:
|
||||
type: object
|
||||
required: true
|
||||
fields:
|
||||
value:
|
||||
type: string
|
||||
required: false
|
||||
code:
|
||||
type: string
|
||||
required: false
|
||||
name:
|
||||
type: string
|
||||
required: false
|
||||
region_code:
|
||||
type: string
|
||||
required: false
|
||||
type:
|
||||
type: string
|
||||
required: false
|
||||
input_mapping:
|
||||
rules:
|
||||
- source: $.mcp.query
|
||||
target: $.request.body.query
|
||||
required: true
|
||||
- source: $.mcp.count
|
||||
target: $.request.body.count
|
||||
required: false
|
||||
default_value: 5
|
||||
output_mapping:
|
||||
rules:
|
||||
- source: $.response.body.suggestions[0].value
|
||||
target: $.output.value
|
||||
required: false
|
||||
- source: $.response.body.suggestions[0].data.code
|
||||
target: $.output.code
|
||||
required: false
|
||||
- source: $.response.body.suggestions[0].data.name
|
||||
target: $.output.name
|
||||
required: false
|
||||
- source: $.response.body.suggestions[0].data.region_code
|
||||
target: $.output.region_code
|
||||
required: false
|
||||
- source: $.response.body.suggestions[0].data.type
|
||||
target: $.output.type
|
||||
required: false
|
||||
execution_config:
|
||||
timeout_ms: 10000
|
||||
retry_policy: null
|
||||
response_cache: null
|
||||
auth_profile_ref: null
|
||||
headers: {}
|
||||
protocol_options: null
|
||||
streaming: null
|
||||
tool_description:
|
||||
title: Найти подразделение ФМС/МВД
|
||||
description: Ищет подразделение, выдавшее паспорт, по коду или названию.
|
||||
tags:
|
||||
- dadata
|
||||
- fms
|
||||
- passport
|
||||
- rest
|
||||
examples:
|
||||
- input:
|
||||
query: "772-053"
|
||||
count: 5
|
||||
config_export:
|
||||
format_version: "1"
|
||||
export_mode: portable
|
||||
Reference in New Issue
Block a user