Skip to main content
Glama
fkom13

MCP SFTP Orchestrator

by fkom13

Ajouter/Modifier un alias de serveur

server_add

Add or update server connection details for SSH/SFTP management, requiring either a key path or password for authentication.

Instructions

Enregistre ou met à jour les informations de connexion d'un serveur. Vous devez fournir soit un chemin de clé, soit un mot de passe.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.js:65-78 (handler)
    Inline handler function that destructures input parameters, calls the servers.addServer helper, and formats the response or error payload.
    async (params) => {
        try {
            const { alias, ...serverConfig } = params;
            const result = await servers.addServer(alias, serverConfig);
            return { content: [{ type: "text", text: result.message }] };
        } catch (e) {
            const errorPayload = {
                toolName: "server_add",
                errorCode: "TOOL_EXECUTION_ERROR",
                errorMessage: e.message
            };
            return { content: [{ type: "text", text: JSON.stringify(errorPayload, null, 2) }], isError: true };
        }
    }
  • Core logic for adding or updating a server configuration in the servers.json file by reading, modifying, and writing the JSON data.
    async function addServer(alias, config) {
        const servers = await readServers();
        if (servers[alias]) {
            // L'alias existe, on le met à jour
            servers[alias] = { ...servers[alias], ...config };
            await writeServers(servers);
            return { success: true, message: `Serveur '${alias}' mis à jour avec succès.` };
        }
        // L'alias n'existe pas, on le crée
        servers[alias] = config;
        await writeServers(servers);
        return { success: true, message: `Serveur '${alias}' ajouté avec succès.` };
    }
  • Zod schema validating input parameters: required alias, host, user; optional keyPath or password (at least one auth method required).
        inputSchema: z.object({
            alias: z.string().describe("Nom court et unique pour le serveur (ex: vps_production)"),
            host: z.string().describe("Adresse IP ou nom d'hôte du serveur"),
            user: z.string().describe("Nom d'utilisateur pour la connexion"),
            keyPath: z.string().optional().describe("Chemin absolu vers la clé privée SSH."),
            password: z.string().optional().describe("Mot de passe pour la connexion.")
        }).refine(data => data.keyPath || data.password, {
            message: "Vous devez fournir au moins une méthode d'authentification ('keyPath' ou 'password')."
        })
    },
  • server.js:50-79 (registration)
    Full registration of the 'server_add' tool with McpServer, including name, metadata, schema, and handler function.
    server.registerTool(
        "server_add",
        {
            title: "Ajouter/Modifier un alias de serveur",
            description: "Enregistre ou met à jour les informations de connexion d'un serveur. Vous devez fournir soit un chemin de clé, soit un mot de passe.",
            inputSchema: z.object({
                alias: z.string().describe("Nom court et unique pour le serveur (ex: vps_production)"),
                host: z.string().describe("Adresse IP ou nom d'hôte du serveur"),
                user: z.string().describe("Nom d'utilisateur pour la connexion"),
                keyPath: z.string().optional().describe("Chemin absolu vers la clé privée SSH."),
                password: z.string().optional().describe("Mot de passe pour la connexion.")
            }).refine(data => data.keyPath || data.password, {
                message: "Vous devez fournir au moins une méthode d'authentification ('keyPath' ou 'password')."
            })
        },
        async (params) => {
            try {
                const { alias, ...serverConfig } = params;
                const result = await servers.addServer(alias, serverConfig);
                return { content: [{ type: "text", text: result.message }] };
            } catch (e) {
                const errorPayload = {
                    toolName: "server_add",
                    errorCode: "TOOL_EXECUTION_ERROR",
                    errorMessage: e.message
                };
                return { content: [{ type: "text", text: JSON.stringify(errorPayload, null, 2) }], isError: true };
            }
        }
    );
Behavior2/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 implies a mutation operation ('enregistre ou met à jour') but doesn't cover critical aspects like authentication requirements, whether changes are reversible, potential side effects, or error handling. This is inadequate for a tool that modifies server data.

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 directly states the tool's function and key requirement without any wasted words. It is appropriately sized and front-loaded with 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?

Given the complexity of a server configuration tool with no annotations and no output schema, the description is insufficient. It lacks details on what 'informations de connexion' includes, how updates are handled, what happens on success/failure, and how this interacts with sibling tools, leaving the agent under-informed.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so the baseline is 4. The description adds value by specifying that either a key path or password must be provided, which clarifies the expected inputs beyond the empty schema, earning a slight boost.

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 ('enregistre ou met à jour') and resource ('informations de connexion d'un serveur'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'server_list' or 'server_remove', which would be needed for a perfect score.

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 by mentioning 'soit un chemin de clé, soit un mot de passe', but it doesn't explain when to use this tool versus alternatives like 'server_remove' or 'api_add', nor does it specify prerequisites or exclusions. This leaves significant gaps in usage context.

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