Document Tools
Agrega fondo, fuente monoespaciada y enlaces clicables al repositorio
Llama a esta herramienta desde tu código en tres lenguajes.
curl -X POST 'https://api.elysiatools.com/es/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"}'Envía una petición POST con tus entradas en JSON. Los parámetros de tipo archivo requieren una subida previa.
POST https://api.elysiatools.com/es/api/tools/pdf-code-snippet-viewer| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| snippetsJson | textarea | Sí | — |
| repoBaseUrl | text | No | — |
| branch | text | No | — |
| pageSize | select | No | — |
| landscape | checkbox | No | — |
| theme | select | No | — |
Resultado de archivo
{
"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)"
}Añade esta herramienta a tu servidor Model Context Protocol para que los agentes de IA puedan listarla y llamarla.
Añade este bloque a la configuración de tu cliente MCP:
{
"mcpServers": {
"elysiatools-pdf-code-snippet-viewer": {
"name": "pdf-code-snippet-viewer",
"description": "Agrega fondo, fuente monoespaciada y enlaces clicables al repositorio",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=pdf-code-snippet-viewer",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Tras conectar al endpoint SSE, lista las herramientas expuestas:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoca la herramienta por su id; los argumentos se construyen a partir de sus 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"
}
}
}¿Dudas o problemas? Contacta con [email protected]