api_remove
Remove an API from the catalog using its alias to manage and maintain the API inventory within the MCP SFTP Orchestrator server.
Instructions
Supprime une API du catalogue en utilisant son alias.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alias | Yes | Alias de l'API à supprimer. |
Implementation Reference
- server.js:162-179 (registration)Registers the 'api_remove' tool, including title, description, input schema requiring 'alias', and a thin handler that delegates to 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 }; } } );
- server.js:164-170 (schema)Schema definition for the api_remove tool input: requires 'alias' string.{ 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.") }) },
- server.js:171-178 (handler)The direct handler function for the api_remove tool: extracts alias, calls apis.removeApi, returns success message or error.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 (helper)Core helper function removeApi: loads config if needed, checks existence, deletes entry from apis object, saves 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.` }; }