Document Tools
Adiciona fundo, fonte monoespacada e links clicaveis para o repositorio
Chame esta ferramenta a partir do seu código em três idiomas.
curl -X POST 'https://api.elysiatools.com/pt/api/tools/pdf-code-snippet-viewer' \
-H 'Content-Type: application/json' \
-d '{"snippetsJson":"[{\"filePath\":\"src/index.ts\",\"language\":\"ts\",\"startLine\":1,\"endLine\":8,\"code\":\"import { Elysia } from '\''elysia'\''\\n\\nconst app = new Elysia()\\n\\napp.get('\''/'\'', () => '\''ok'\'')\\n\\nexport default app\"},{\"filePath\":\"src/tools/2026-02-13/pdf-link-annotator.ts\",\"language\":\"ts\",\"startLine\":30,\"endLine\":52,\"code\":\"function addExternalLink(pdf, page, x, y, w, h, url) {\\n const annot = pdf.context.obj({\\n Type: '\''Annot'\'',\\n Subtype: '\''Link'\'',\\n })\\n // ...\\n}\"}]","repoBaseUrl":"https://github.com/example/repo","branch":"main","pageSize":"A4","landscape":false,"theme":"light"}'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-code-snippet-viewer| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| snippetsJson | textarea | Sim | — |
| repoBaseUrl | text | Não | — |
| branch | text | Não | — |
| pageSize | select | Não | — |
| landscape | checkbox | Não | — |
| theme | 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-code-snippet-viewer": {
"name": "pdf-code-snippet-viewer",
"description": "Adiciona fundo, fonte monoespacada e links clicaveis para o repositorio",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-code-snippet-viewer",
"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-code-snippet-viewer",
"arguments": {
"snippetsJson": "[{\"filePath\":\"src/index.ts\",\"language\":\"ts\",\"startLine\":1,\"endLine\":8,\"code\":\"import { Elysia } from 'elysia'\\n\\nconst app = new Elysia()\\n\\napp.get('/', () => 'ok')\\n\\nexport default app\"},{\"filePath\":\"src/tools/2026-02-13/pdf-link-annotator.ts\",\"language\":\"ts\",\"startLine\":30,\"endLine\":52,\"code\":\"function addExternalLink(pdf, page, x, y, w, h, url) {\\n const annot = pdf.context.obj({\\n Type: 'Annot',\\n Subtype: 'Link',\\n })\\n // ...\\n}\"}]",
"repoBaseUrl": "https://github.com/example/repo",
"branch": "main",
"pageSize": "A4",
"landscape": false,
"theme": "light"
}
}
}Dúvidas ou problemas? Contate [email protected]