Document Tools
Build a PDF with a generated table of contents and section placeholders
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/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}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/pdf-section-toc-generator| Name | Type | Required | Description |
|---|---|---|---|
| sections | textarea | Yes | — |
| tocTitle | text | No | — |
| startPageNumber | number | No | — |
| pageSize | select | No | — |
| orientation | select | No | — |
| marginTop |
Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-pdf-section-toc-generator": {
"name": "pdf-section-toc-generator",
"description": "Build a PDF with a generated table of contents and section placeholders",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-section-toc-generator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"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 |
| No |
| — |
| marginBottom | number | No | — |
| marginLeft | number | No | — |
| marginRight | number | No | — |
| tocTitleSize | number | No | — |
| tocEntrySize | number | No | — |
| sectionTitleSize | number | No | — |
| showLeaders | checkbox | No | — |
| leaderStyle | select | No | — |
| showPageNumbers | checkbox | No | — |
File result
{
"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)"
}Questions or issues? Contact [email protected]