Corregir errores de tipos en docker_logs
All checks were successful
build-and-deploy / build (push) Successful in 13s
build-and-deploy / deploy (push) Successful in 3s

- Remover parámetro follow del inputSchema y handler
- Forzar follow: false en container.logs()
- Solucionar error TS2769 y TS2554
This commit is contained in:
2025-10-13 19:32:04 -06:00
parent 16af248cf1
commit 3af2abb68f

View File

@@ -66,21 +66,20 @@ server.registerTool(
description: 'Obtiene los logs de un contenedor específico', description: 'Obtiene los logs de un contenedor específico',
inputSchema: { inputSchema: {
container_id: z.string().describe('ID o nombre del contenedor'), container_id: z.string().describe('ID o nombre del contenedor'),
tail: z.number().optional().describe('Número de líneas desde el final (default: 100)'), tail: z.number().optional().describe('Número de líneas desde el final (default: 100)')
follow: z.boolean().optional().describe('Seguir logs en tiempo real (no recomendado para MCP)')
}, },
outputSchema: { outputSchema: {
logs: z.string() logs: z.string()
} }
}, },
async ({ container_id, tail = 100, follow = false }) => { async ({ container_id, tail = 100 }) => {
try { try {
const container = docker.getContainer(container_id); const container = docker.getContainer(container_id);
const logs = await container.logs({ const logs = await container.logs({
stdout: true, stdout: true,
stderr: true, stderr: true,
tail, tail,
follow follow: false
}); });
const output = { logs: logs.toString('utf-8') }; const output = { logs: logs.toString('utf-8') };
return { return {