Skip to main content
Glama

task_retry

Retry a failed or crashed task in the SFTP Orchestrator by providing its task ID to resume execution.

Instructions

Relance une tâche qui a échoué ou crashé.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesL'ID de la tâche à réessayer.

Implementation Reference

  • The handler function for the 'task_retry' tool. It retrieves the failed job using queue.retryJob, creates a new job, re-executes it based on its type (sftp, ssh, or ssh_sequence) by calling the appropriate execute method, and returns success or error response.
    async (params) => { try { const newJob = await queue.retryJob(params.id); // Relancer selon le type if (newJob.type === 'sftp') { sftp.executeTransfer(newJob.id); } else if (newJob.type === 'ssh') { ssh.executeCommand(newJob.id); } else if (newJob.type === 'ssh_sequence') { ssh.executeCommandSequence(newJob.id); } return { content: [{ type: "text", text: `Tâche ${params.id} relancée avec le nouvel ID: ${newJob.id}` }] }; } catch (e) { const errorPayload = { toolName: "task_retry", errorCode: "TOOL_EXECUTION_ERROR", errorMessage: e.message }; return { content: [{ type: "text", text: JSON.stringify(errorPayload, null, 2) }], isError: true }; } }
  • The schema definition for the 'task_retry' tool, specifying the input as an object with a required 'id' string parameter.
    { title: "Réessayer une tâche échouée", description: "Relance une tâche qui a échoué ou crashé.", inputSchema: z.object({ id: z.string().describe("L'ID de la tâche à réessayer.") })
  • server.js:649-681 (registration)
    The registration of the 'task_retry' tool using server.registerTool, including the tool name, schema, and inline handler function.
    server.registerTool( "task_retry", { title: "Réessayer une tâche échouée", description: "Relance une tâche qui a échoué ou crashé.", inputSchema: z.object({ id: z.string().describe("L'ID de la tâche à réessayer.") }) }, async (params) => { try { const newJob = await queue.retryJob(params.id); // Relancer selon le type if (newJob.type === 'sftp') { sftp.executeTransfer(newJob.id); } else if (newJob.type === 'ssh') { ssh.executeCommand(newJob.id); } else if (newJob.type === 'ssh_sequence') { ssh.executeCommandSequence(newJob.id); } return { content: [{ type: "text", text: `Tâche ${params.id} relancée avec le nouvel ID: ${newJob.id}` }] }; } catch (e) { const errorPayload = { toolName: "task_retry", errorCode: "TOOL_EXECUTION_ERROR", errorMessage: e.message }; return { content: [{ type: "text", text: JSON.stringify(errorPayload, null, 2) }], isError: true }; } } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fkom13/mcp-sftp-orchestrator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server