Document Tools
Converte JSON TipTap/Quill/Slate em PDF
Chame esta ferramenta a partir do seu código em três idiomas.
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/richtext-json-to-pdf' \
-F 'file=@/path/to/jsonFile.ext'
# 2) Call the tool with the returned filePath values
curl -X POST 'https://api.elysiatools.com/pt/api/tools/richtext-json-to-pdf' \
-F 'jsonContent={"type":"doc","content":[{"type":"heading","attrs":{"level":2},"content":[{"type":"text","text":"Release Update"}]},{"type":"paragraph","content":[{"type":"text","text":"Generated sample."}]}]}' \
-F 'jsonFile=/path/to/file.ext' \
-F 'editorType=tiptap' \
-F 'documentTitle=TipTap Sample' \
-F 'baseFontSize=13' \
-F 'pageSize=A4' \
-F 'landscape=false' \
-F 'printBackground=true' \
-F 'marginTop=18' \
-F 'marginBottom=18' \
-F 'marginLeft=18' \
-F 'marginRight=18' \
-F 'waitUntil=networkidle0' \
-F 'waitTime=0'Envie uma requisição POST com suas entradas em JSON. Parâmetros do tipo arquivo exigem upload prévio.
POST https://api.elysiatools.com/pt/api/tools/richtext-json-to-pdf| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| jsonContent | textarea | Não | — |
| jsonFile | fileupload necessário | Não | — |
| editorType | select | Não | — |
| documentTitle | text | Não | — |
| baseFontSize | number | Não | — |
| pageSize | select | Não | — |
| landscape | checkbox | Não | — |
| printBackground | checkbox | Não | — |
| marginTop | number | Não | — |
| marginBottom | number | Não | — |
| marginLeft | number | Não | — |
| marginRight | number | Não | — |
| waitUntil | select | Não | — |
| waitTime | number | Não | — |
Resultado de arquivo
{
"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)"
}Adicione esta ferramenta ao seu servidor Model Context Protocol para que agentes de IA possam listá-la e chamá-la.
Adicione este bloco à configuração do seu cliente MCP:
{
"mcpServers": {
"elysiatools-richtext-json-to-pdf": {
"name": "richtext-json-to-pdf",
"description": "Converte JSON TipTap/Quill/Slate em PDF",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=richtext-json-to-pdf",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Após conectar ao endpoint SSE, liste as ferramentas expostas:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoque a ferramenta pelo seu id; os argumentos são construídos a partir de seus parâmetros:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "richtext-json-to-pdf",
"arguments": {
"jsonContent": "{\"type\":\"doc\",\"content\":[{\"type\":\"heading\",\"attrs\":{\"level\":2},\"content\":[{\"type\":\"text\",\"text\":\"Release Update\"}]},{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"Generated sample.\"}]}]}",
"jsonFile": "https://example.com/file.ext",
"editorType": "tiptap",
"documentTitle": "TipTap Sample",
"baseFontSize": 13,
"pageSize": "A4",
"landscape": false,
"printBackground": true,
"marginTop": 18,
"marginBottom": 18,
"marginLeft": 18,
"marginRight": 18,
"waitUntil": "networkidle0",
"waitTime": 0
}
}
}Dúvidas ou problemas? Contate [email protected]