Skip to main content
Glama
fkom13

MCP SFTP Orchestrator

by fkom13

server_remove

Remove a server alias from the MCP SFTP Orchestrator configuration to manage remote server connections.

Instructions

Supprime un alias de serveur de la configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasYesNom de l'alias à supprimer

Implementation Reference

  • Core logic for removing a server alias from the servers.json configuration file.
    async function removeServer(alias) {
        const servers = await readServers();
        if (!servers[alias]) {
            throw new Error(`L'alias '${alias}' n'existe pas.`);
        }
        delete servers[alias];
        await writeServers(servers);
        return { success: true, message: `Serveur '${alias}' supprimé.` };
    }
  • MCP tool handler function that invokes servers.removeServer and formats the response.
    async (params) => {
        try {
            const result = await servers.removeServer(params.alias);
            return { content: [{ type: "text", text: result.message }] };
        } catch (e) {
            const errorPayload = {
                toolName: "server_remove",
                errorCode: "TOOL_EXECUTION_ERROR",
                errorMessage: e.message
            };
            return { content: [{ type: "text", text: JSON.stringify(errorPayload, null, 2) }], isError: true };
        }
    }
  • Input schema for the server_remove tool using Zod.
    {
        title: "Supprimer un alias de serveur",
        description: "Supprime un alias de serveur de la configuration.",
        inputSchema: z.object({
            alias: z.string().describe("Nom de l'alias à supprimer")
        })
    },
  • server.js:94-116 (registration)
    Registration of the server_remove tool on the MCP server.
    server.registerTool(
        "server_remove",
        {
            title: "Supprimer un alias de serveur",
            description: "Supprime un alias de serveur de la configuration.",
            inputSchema: z.object({
                alias: z.string().describe("Nom de l'alias à supprimer")
            })
        },
        async (params) => {
            try {
                const result = await servers.removeServer(params.alias);
                return { content: [{ type: "text", text: result.message }] };
            } catch (e) {
                const errorPayload = {
                    toolName: "server_remove",
                    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