Media
Redimensionar imágenes WebP manteniendo el formato y calidad WebP
Llama a esta herramienta desde tu código en tres lenguajes.
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/webp-to-resized-webp' \
-F 'file=@/path/to/imageFile.ext'
# 2) Call the tool with the returned filePath values
curl -X POST 'https://api.elysiatools.com/es/api/tools/webp-to-resized-webp' \
-F 'imageFile=/path/to/file.ext' \
-F 'width=0' \
-F 'height=0' \
-F 'fit=cover' \
-F 'position=center' \
-F 'background=transparent' \
-F 'quality=90' \
-F 'withoutEnlargement=false'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/webp-to-resized-webp| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| imageFile | filesubida requerida | Sí | — |
| width | number | No | Dejar vacío para calcular automáticamente basado en altura y proporción |
| height | number | No | Dejar vacío para calcular automáticamente basado en ancho y proporción |
| fit | select | No | — |
| position | select |
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-webp-to-resized-webp": {
"name": "webp-to-resized-webp",
"description": "Redimensionar imágenes WebP manteniendo el formato y calidad WebP",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=webp-to-resized-webp",
"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": "webp-to-resized-webp",
"arguments": {
"imageFile": "https://example.com/file.ext",
"width": 0,
"height": 0,
"fit": "cover",
"position": "center",
"background": "transparent",
"quality": 90,
"withoutEnlargement": false
}
}
}| — |
| background | text | No | Color de fondo para espacio vacío. Usar formato #RRGGBB o "transparent" |
| quality | range | No | — |
| withoutEnlargement | checkbox | No | Prevenir ampliación cuando las dimensiones objetivo son más grandes que el original |
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)"
}¿Dudas o problemas? Contacta con [email protected]