Document Tools
Создает PDF с оглавлением и страницами разделов
Вызовите этот инструмент из своего кода на трёх языках.
curl -X POST 'https://api.elysiatools.com/ru/api/tools/pdf-section-toc-generator' \
-H 'Content-Type: application/json' \
-d '{"sections":"Introduction|2\nMethods|3\nResults|4\nDiscussion|2\nAppendix|1","tocTitle":"Table of Contents","startPageNumber":2,"pageSize":"A4","orientation":"portrait","marginTop":72,"marginBottom":72,"marginLeft":72,"marginRight":72,"tocTitleSize":20,"tocEntrySize":12,"sectionTitleSize":24,"showLeaders":true,"leaderStyle":"dots","showPageNumbers":true}'Отправьте POST-запрос с входными данными в JSON. Параметры типа «файл» требуют предварительной загрузки.
POST https://api.elysiatools.com/ru/api/tools/pdf-section-toc-generator| Имя | Тип | Обязательный | Описание |
|---|---|---|---|
| sections | textarea | Да | — |
| tocTitle | text | Нет | — |
| startPageNumber | number | Нет | — |
| pageSize | select | Нет | — |
| orientation | select | Нет | — |
| marginTop |
Добавьте этот инструмент на свой сервер Model Context Protocol, чтобы ИИ-агенты могли перечислять и вызывать его.
Добавьте этот блок в конфигурацию вашего MCP-клиента:
{
"mcpServers": {
"elysiatools-pdf-section-toc-generator": {
"name": "pdf-section-toc-generator",
"description": "Создает PDF с оглавлением и страницами разделов",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-section-toc-generator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}После подключения к SSE-endpoint выведите список доступных инструментов:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Вызовите инструмент по его id; аргументы формируются из его параметров:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "pdf-section-toc-generator",
"arguments": {
"sections": "Introduction|2\nMethods|3\nResults|4\nDiscussion|2\nAppendix|1",
"tocTitle": "Table of Contents",
"startPageNumber": 2,
"pageSize": "A4",
"orientation": "portrait",
"marginTop": 72,
"marginBottom": 72,
"marginLeft": 72,
"marginRight": 72,
"tocTitleSize": 20,
"tocEntrySize": 12,
"sectionTitleSize": 24,
"showLeaders": true,
"leaderStyle": "dots",
"showPageNumbers": true
}
}
}| number |
| Нет |
| — |
| marginBottom | number | Нет | — |
| marginLeft | number | Нет | — |
| marginRight | number | Нет | — |
| tocTitleSize | number | Нет | — |
| tocEntrySize | number | Нет | — |
| sectionTitleSize | number | Нет | — |
| showLeaders | checkbox | Нет | — |
| leaderStyle | select | Нет | — |
| showPageNumbers | checkbox | Нет | — |
Файловый результат
{
"filePath": "/public/processing/randomid.ext",
"fileName": "output.ext",
"contentType": "application/octet-stream",
"size": 1024,
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}Вопросы или проблемы? Свяжитесь с [email protected]