Document Tools
Criar documentos PDF com texto, parágrafos, cabeçalhos e rodapés
Chame esta ferramenta a partir do seu código em três idiomas.
curl -X POST 'https://api.elysiatools.com/pt/api/tools/pdf-basic-text-doc' \
-H 'Content-Type: application/json' \
-d '{"content":"Digite o conteúdo do seu documento aqui...\n\nVocê pode separar parágrafos com linhas em branco.","title":"Meu Documento","pageSize":"A4","orientation":"portrait","fontSize":12,"lineHeight":1.5,"marginTop":72,"marginBottom":72,"marginLeft":72,"marginRight":72,"showHeader":false,"headerText":"Cabeçalho do Documento","headerAlignment":"center","showFooter":false,"footerText":"Page {page} of {total}","footerAlignment":"center","showPageNumbers":true,"pageNumberPosition":"bottom-center"}'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/pdf-basic-text-doc| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| content | textarea | Sim | — |
| title | text | Não | — |
| pageSize | select | Não | — |
| orientation | select | Não | — |
| fontSize | number | Não | — |
| lineHeight | number | Não | — |
| marginTop | number | Não | — |
| marginBottom | number | Não | — |
| marginLeft | number | Não | — |
| marginRight | number | Não | — |
| showHeader | checkbox | Não | — |
| headerText | text | Não | — |
| headerAlignment | select | Não | — |
| showFooter | checkbox | Não | — |
| footerText | text | Não | — |
| footerAlignment | select | Não | — |
| showPageNumbers | checkbox | Não | — |
| pageNumberPosition | select | 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-pdf-basic-text-doc": {
"name": "pdf-basic-text-doc",
"description": "Criar documentos PDF com texto, parágrafos, cabeçalhos e rodapés",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-basic-text-doc",
"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": "pdf-basic-text-doc",
"arguments": {
"content": "Digite o conteúdo do seu documento aqui...\n\nVocê pode separar parágrafos com linhas em branco.",
"title": "Meu Documento",
"pageSize": "A4",
"orientation": "portrait",
"fontSize": 12,
"lineHeight": 1.5,
"marginTop": 72,
"marginBottom": 72,
"marginLeft": 72,
"marginRight": 72,
"showHeader": false,
"headerText": "Cabeçalho do Documento",
"headerAlignment": "center",
"showFooter": false,
"footerText": "Page {page} of {total}",
"footerAlignment": "center",
"showPageNumbers": true,
"pageNumberPosition": "bottom-center"
}
}
}Dúvidas ou problemas? Contate [email protected]