task_status
Retrieve details and status of a specific task in the MCP SFTP Orchestrator's persistent queue for monitoring remote server operations.
Instructions
Récupère les détails d'une seule tâche, avec un rappel si nécessaire.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | L'ID de la tâche à consulter. |
Implementation Reference
- server.js:485-491 (handler)The main handler function for the 'task_status' tool. Retrieves the job by ID from the queue, checks if it exists, formats it using formatJobForDisplay, and returns the JSON stringified details.async (params) => { const job = queue.getJob(params.id); if (!job) return { content: [{ type: "text", text: `ERREUR: Tâche '${params.id}' introuvable.` }], isError: true }; const displayJob = formatJobForDisplay(job); return { content: [{ type: "text", text: JSON.stringify(displayJob, null, 2) }] }; }
- server.js:481-483 (schema)Input schema for the 'task_status' tool using Zod, requiring a single 'id' string parameter.inputSchema: z.object({ id: z.string().describe("L'ID de la tâche à consulter.") })
- server.js:476-492 (registration)Registration of the 'task_status' tool on the MCP server, including title, description, input schema, and handler function.server.registerTool( "task_status", { title: "Consulter une tâche par son ID", description: "Récupère les détails d'une seule tâche, avec un rappel si nécessaire.", inputSchema: z.object({ id: z.string().describe("L'ID de la tâche à consulter.") }) }, async (params) => { const job = queue.getJob(params.id); if (!job) return { content: [{ type: "text", text: `ERREUR: Tâche '${params.id}' introuvable.` }], isError: true }; const displayJob = formatJobForDisplay(job); return { content: [{ type: "text", text: JSON.stringify(displayJob, null, 2) }] }; } );
- server.js:453-459 (helper)Helper function used by the task_status handler to format the job object for display, adding a reminder message if the reminder time has passed for running jobs.function formatJobForDisplay(job) { const displayJob = { ...job }; if (job.status === 'running' && job.reminderAt && new Date() > new Date(job.reminderAt)) { displayJob.reminder = "ATTENTION: Le temps de rappel est écoulé. La tâche est peut-être terminée ou bloquée."; } return displayJob; }