Skip to main content
Glama
fkom13

MCP SFTP Orchestrator

by fkom13

Ajouter une API au catalogue

api_add

Add or update APIs in the monitoring catalog for health checks and authentication configuration within the SFTP Orchestrator server.

Instructions

Ajoute ou met à jour une API dans le catalogue de monitoring.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasYesAlias unique pour l'API.
urlYesURL de base de l'API, incluant le port si nécessaire.
health_check_endpointNoEndpoint spécifique pour le test de santé (ex: /health).
health_check_methodNoMéthode HTTP pour le test de santé.GET
auth_methodNoMéthode d'authentification.none
api_keyNoClé API si nécessaire.
auth_header_nameNoNom du header pour la clé API.Authorization
auth_schemeNoSchéma d'authentification (ex: Bearer). Mettre à '' si non applicable.Bearer
htpasswd_userNoNom d'utilisateur pour l'authentification Basic (htpasswd).
htpasswd_passNoMot de passe pour l'authentification Basic (htpasswd).
notesNoNotes additionnelles.

Implementation Reference

  • apis.js:46-68 (handler)
    Core handler logic for adding or updating an API entry in the JSON store with validation.
    async function addApi(alias, apiConfig) {
        await ensureInitialized();
        
        // Validation
        if (!alias || typeof alias !== 'string') {
            throw new Error("L'alias doit être une chaîne non vide.");
        }
        
        if (!apiConfig.url) {
            throw new Error("L'URL de l'API est obligatoire.");
        }
        
        // Valider l'URL
        try {
            new URL(apiConfig.url);
        } catch (e) {
            throw new Error(`URL invalide: ${apiConfig.url}`);
        }
        
        apis[alias] = apiConfig;
        await saveApis();
        return { success: true, message: `API '${alias}' ajoutée/mise à jour avec succès.` };
    }
  • Input schema definition for the api_add tool using Zod validation.
    title: "Ajouter une API au catalogue",
    description: "Ajoute ou met à jour une API dans le catalogue de monitoring.",
    inputSchema: z.object({
        alias: z.string().describe("Alias unique pour l'API."),
        url: z.string().url().describe("URL de base de l'API, incluant le port si nécessaire."),
        health_check_endpoint: z.string().optional().describe("Endpoint spécifique pour le test de santé (ex: /health)."),
        health_check_method: z.enum(['GET', 'POST']).optional().default('GET').describe("Méthode HTTP pour le test de santé."),
        auth_method: z.enum(['api_key', 'htpasswd', 'both', 'none']).optional().default('none').describe("Méthode d'authentification."),
        api_key: z.string().optional().describe("Clé API si nécessaire."),
        auth_header_name: z.string().optional().default('Authorization').describe("Nom du header pour la clé API."),
        auth_scheme: z.string().optional().default('Bearer').describe("Schéma d'authentification (ex: Bearer). Mettre à '' si non applicable."),
        htpasswd_user: z.string().optional().describe("Nom d'utilisateur pour l'authentification Basic (htpasswd)."),
        htpasswd_pass: z.string().optional().describe("Mot de passe pour l'authentification Basic (htpasswd)."),
        notes: z.string().optional().describe("Notes additionnelles.")
    })
  • server.js:119-147 (registration)
    MCP tool registration for 'api_add' with schema and wrapper handler.
    server.registerTool(
        "api_add",
        {
            title: "Ajouter une API au catalogue",
            description: "Ajoute ou met à jour une API dans le catalogue de monitoring.",
            inputSchema: z.object({
                alias: z.string().describe("Alias unique pour l'API."),
                url: z.string().url().describe("URL de base de l'API, incluant le port si nécessaire."),
                health_check_endpoint: z.string().optional().describe("Endpoint spécifique pour le test de santé (ex: /health)."),
                health_check_method: z.enum(['GET', 'POST']).optional().default('GET').describe("Méthode HTTP pour le test de santé."),
                auth_method: z.enum(['api_key', 'htpasswd', 'both', 'none']).optional().default('none').describe("Méthode d'authentification."),
                api_key: z.string().optional().describe("Clé API si nécessaire."),
                auth_header_name: z.string().optional().default('Authorization').describe("Nom du header pour la clé API."),
                auth_scheme: z.string().optional().default('Bearer').describe("Schéma d'authentification (ex: Bearer). Mettre à '' si non applicable."),
                htpasswd_user: z.string().optional().describe("Nom d'utilisateur pour l'authentification Basic (htpasswd)."),
                htpasswd_pass: z.string().optional().describe("Mot de passe pour l'authentification Basic (htpasswd)."),
                notes: z.string().optional().describe("Notes additionnelles.")
            })
        },
        async (params) => {
            try {
                const { alias, ...apiConfig } = params;
                const result = await apis.addApi(alias, apiConfig);
                return { content: [{ type: "text", text: result.message }] };
            } catch (e) {
                return { content: [{ type: "text", text: `ERREUR: ${e.message}` }], isError: true };
            }
        }
    );
  • Wrapper handler for the api_add tool that delegates to apis.addApi and formats MCP response.
    async (params) => {
        try {
            const { alias, ...apiConfig } = params;
            const result = await apis.addApi(alias, apiConfig);
            return { content: [{ type: "text", text: result.message }] };
        } catch (e) {
            return { content: [{ type: "text", text: `ERREUR: ${e.message}` }], 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 states the tool adds or updates an API in a monitoring catalog, implying a write/mutation operation, but doesn't clarify if this is idempotent, what happens on conflicts (e.g., duplicate aliases), whether updates are partial or full, or any side effects like triggering health checks. For a mutation tool with 11 parameters, 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 directly states the tool's purpose without redundancy. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, with no wasted verbiage.

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 tool's complexity (11 parameters, mutation operation) and lack of annotations or output schema, the description is incomplete. It doesn't address behavioral aspects like error handling, idempotency, or return values, leaving significant gaps for an AI agent to understand how to invoke it correctly in a monitoring 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?

The description adds no parameter-specific information beyond what the schema provides. Since schema description coverage is 100%, the baseline score is 3. The description doesn't explain relationships between parameters (e.g., how auth_method interacts with api_key or htpasswd fields) or provide examples, so it doesn't compensate for the schema's limitations.

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 action ('Ajoute ou met à jour') and resource ('une API dans le catalogue de monitoring'), making the purpose explicit. It distinguishes from sibling tools like api_list and api_remove by focusing on addition/update rather than listing or removal. However, it doesn't explicitly differentiate from server_add or other catalog-related tools beyond the API scope.

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 no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., when an API should be added vs. updated), nor does it reference sibling tools like api_check or api_remove for complementary operations. Usage is implied through the action but lacks explicit 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