Skip to main content
Glama
fkom13

MCP SFTP Orchestrator

by fkom13

Exécuter une commande à distance (SSH)

task_exec

Execute SSH commands on remote servers through the MCP SFTP Orchestrator. Commands complete directly if under 30 seconds or run in background for longer tasks.

Instructions

Exécute une commande SSH. Si la tâche prend moins de 30s, le résultat est direct. Sinon, elle passe en arrière-plan.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasYesAlias du serveur cible.
cmdYesLa commande complète à exécuter.
rappelNoDéfinit un rappel en secondes.

Implementation Reference

  • Handler function that queues an SSH execution job using queue.addJob, logs it, executes via ssh.executeCommand, polls for completion with waitForJobCompletion, and returns synchronous result or background initiation message.
        async (params) => {
            const job = queue.addJob({ type: 'ssh', ...params, status: 'pending' });
            history.logTask(job);
            ssh.executeCommand(job.id);
    
            const finalJob = await waitForJobCompletion(job.id, config.syncTimeout);
            if (finalJob) {
                return { content: [{ type: "text", text: `Résultat direct (tâche ${finalJob.id}):
    ${finalJob.output || JSON.stringify(finalJob, null, 2)}` }] };
            } else {
                return { content: [{ type: "text", text: `Tâche d'exécution ${job.id} initiée en arrière-plan.` }] };
            }
        }
    );
  • Tool metadata including title, description, and Zod inputSchema defining parameters: alias (server alias), cmd (command to execute), optional rappel (reminder in seconds).
    {
        title: "Exécuter une commande à distance (SSH)",
                    description: `Exécute une commande SSH. Si la tâche prend moins de ${config.syncTimeout / 1000}s, le résultat est direct. Sinon, elle passe en arrière-plan.`, 
                    inputSchema: z.object({
                        alias: z.string().describe("Alias du serveur cible."),
                    cmd: z.string().describe("La commande complète à exécuter."),
                    rappel: z.number().optional().describe("Définit un rappel en secondes.")
                    })
    },
  • server.js:427-450 (registration)
    MCP server registration of the 'task_exec' tool, including schema and inline handler implementation.
        "task_exec",
        {
            title: "Exécuter une commande à distance (SSH)",
                        description: `Exécute une commande SSH. Si la tâche prend moins de ${config.syncTimeout / 1000}s, le résultat est direct. Sinon, elle passe en arrière-plan.`, 
                        inputSchema: z.object({
                            alias: z.string().describe("Alias du serveur cible."),
                        cmd: z.string().describe("La commande complète à exécuter."),
                        rappel: z.number().optional().describe("Définit un rappel en secondes.")
                        })
        },
        async (params) => {
            const job = queue.addJob({ type: 'ssh', ...params, status: 'pending' });
            history.logTask(job);
            ssh.executeCommand(job.id);
    
            const finalJob = await waitForJobCompletion(job.id, config.syncTimeout);
            if (finalJob) {
                return { content: [{ type: "text", text: `Résultat direct (tâche ${finalJob.id}):
    ${finalJob.output || JSON.stringify(finalJob, null, 2)}` }] };
            } else {
                return { content: [{ type: "text", text: `Tâche d'exécution ${job.id} initiée en arrière-plan.` }] };
            }
        }
    );
  • Helper function used by task_exec (and other tools) to asynchronously wait for job completion with polling and timeout.
    async function waitForJobCompletion(jobId, timeout) {
        return new Promise((resolve) => {
            const startTime = Date.now();
            const interval = setInterval(() => {
                const job = queue.getJob(jobId);
                if (job.status === 'completed' || job.status === 'failed') {
                    clearInterval(interval);
                    resolve(job);
                } else if (Date.now() - startTime > timeout) {
                    clearInterval(interval);
                    resolve(null);
                }
            }, 200);
        });
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals important execution behavior (30-second threshold determining synchronous vs. asynchronous operation) and mentions background processing. However, it doesn't cover other critical aspects like authentication requirements, error handling, rate limits, or what 'background' execution entails for result retrieval.

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 extremely concise (two sentences) with zero wasted words. It's front-loaded with the core purpose and immediately follows with critical behavioral information. Every sentence earns its place by providing essential operational context.

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

Completeness3/5

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

For a tool with no annotations and no output schema, the description provides basic operational context but leaves significant gaps. It doesn't explain how to retrieve results from background tasks, what the output format looks like, error conditions, or security implications. The 30-second threshold is helpful, but more completeness is needed for a remote execution tool.

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?

With 100% schema description coverage, the schema already documents all three parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, nor does it explain relationships between parameters. The baseline score of 3 reflects adequate but not enhanced parameter documentation.

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

Purpose5/5

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

The description clearly states the specific action ('Exécute une commande SSH') and resource (remote server via SSH), distinguishing it from sibling tools like task_exec_interactive or task_exec_sequence. It provides precise operational details about execution timing that further differentiate its purpose.

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

Usage Guidelines4/5

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

The description implies usage context by specifying the 30-second threshold for direct vs. background execution, which helps determine when this tool is appropriate. However, it doesn't explicitly state when to use this versus alternatives like task_exec_interactive or task_exec_sequence, nor does it provide exclusion criteria.

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