Skip to main content
Glama

api_remove

Remove an API from the catalog using its alias to manage and clean up API endpoints in the SFTP Orchestrator server.

Instructions

Supprime une API du catalogue en utilisant son alias.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasYesAlias de l'API à supprimer.

Implementation Reference

  • server.js:162-179 (registration)
    Registration of the 'api_remove' MCP tool, including title, description, input schema (alias string), and handler that calls apis.removeApi
    server.registerTool( "api_remove", { title: "Supprimer une API du catalogue", description: "Supprime une API du catalogue en utilisant son alias.", inputSchema: z.object({ alias: z.string().describe("Alias de l'API à supprimer.") }) }, async (params) => { try { const result = await apis.removeApi(params.alias); return { content: [{ type: "text", text: result.message }] }; } catch (e) { return { content: [{ type: "text", text: `ERREUR: ${e.message}` }], isError: true }; } } );
  • apis.js:87-95 (handler)
    Core implementation of API removal: checks existence, deletes from in-memory store, persists to apis.json file, returns success message
    async function removeApi(alias) { await ensureInitialized(); if (!apis[alias]) { throw new Error(`L'alias d'API '${alias}' est inconnu.`); } delete apis[alias]; await saveApis(); return { success: true, message: `API '${alias}' supprimée avec succès.` }; }
  • Input schema validation using Zod: requires 'alias' as string with description
    { title: "Supprimer une API du catalogue", description: "Supprime une API du catalogue en utilisant son alias.", inputSchema: z.object({ alias: z.string().describe("Alias de l'API à supprimer.") }) },
  • apis.js:36-43 (helper)
    Helper function to persist the APIs object to JSON file, called after removal
    async function saveApis() { await ensureInitialized(); try { await fs.writeFile(APIS_FILE, JSON.stringify(apis, null, 2)); } catch (err) { console.error("Erreur lors de la sauvegarde de apis.json:", err); } }
  • apis.js:27-33 (helper)
    Initialization helper ensuring APIs are loaded from file before operations like removeApi
    async function ensureInitialized() { if (isInitialized) return; if (!initPromise) { initPromise = loadApis().then(() => { isInitialized = true; }); } return initPromise; }

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