Skip to main content
Glama
fkom13

MCP SFTP Orchestrator

by fkom13

Réessayer une tâche échouée

task_retry

Retry failed or crashed tasks in the SFTP Orchestrator to maintain workflow continuity and resolve execution issues.

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

  • server.js:649-681 (registration)
    Registration of the task_retry tool including schema and 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 };
            }
        }
    );
  • Core retryJob function that creates a new pending job from a failed or crashed one, increments retry count, and handles limits.
    async function retryJob(id) {
        const job = jobQueue[id];
        if (!job) {
            throw new Error(`Tâche ${id} introuvable`);
        }
        
        if (!['failed', 'crashed'].includes(job.status)) {
            throw new Error(`La tâche ${id} ne peut pas être réessayée (statut: ${job.status})`);
        }
        
        if (job.retryCount >= job.maxRetries) {
            throw new Error(`La tâche ${id} a atteint le nombre max de tentatives (${job.maxRetries})`);
        }
        
        const newJob = {
            ...job,
            id: uuidv4().split('-')[0],
            status: 'pending',
            retryCount: (job.retryCount || 0) + 1,
            retriedFrom: id,
            createdAt: new Date(),
            updatedAt: new Date(),
            error: null,
            output: null
        };
        
        delete newJob.failedAt;
        delete newJob.crashedAt;
        delete newJob.completedAt;
        
        jobQueue[newJob.id] = newJob;
        isDirty = true;
        
        log('info', `Tâche ${id} réessayée -> nouvelle tâche ${newJob.id} (tentative ${newJob.retryCount}/${newJob.maxRetries})`);
        
        return newJob;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action (retry/restart) but doesn't describe what happens during retry: whether it preserves original parameters, creates a new task ID, has side effects, requires specific permissions, or what the expected outcome is. For a mutation tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with no wasted words. It's appropriately sized for this simple tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, what happens to the original task, whether retry preserves configurations, or potential side effects. Given the complexity of task management and lack of structured data, the description should provide more operational context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with the single parameter 'id' well-documented in the schema. The description doesn't add any parameter-specific information beyond what the schema provides. With complete schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('relance' meaning retry/restart) and the resource ('une tâche qui a échoué ou crashé' meaning a failed or crashed task). It distinguishes from siblings like task_exec (execute new task) and task_history (view history), but doesn't explicitly contrast with them. The purpose is specific but lacks explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance - it implies this tool should be used for failed/crashed tasks, but doesn't specify when NOT to use it (e.g., for successful tasks) or mention alternatives like task_exec for new executions. No explicit usage context or prerequisites are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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