Skip to main content
Glama

delete-function

Remove edge functions permanently from your Insforge backend service. Delete specific functions by their slug identifier to manage your serverless deployment resources.

Instructions

Delete an edge function permanently

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesThe slug identifier of the function to delete

Implementation Reference

  • Registration of the 'delete-function' tool using server.tool(), including name, description, input schema, and inline handler wrapped with withUsageTracking.
    server.tool( 'delete-function', 'Delete an edge function permanently', { slug: z.string().describe('The slug identifier of the function to delete'), }, withUsageTracking('delete-function', async (args) => { try { const response = await fetch(`${API_BASE_URL}/api/functions/${args.slug}`, { method: 'DELETE', headers: { 'x-api-key': getApiKey(), }, }); const result = await handleApiResponse(response); return await addBackgroundContext({ content: [ { type: 'text', text: formatSuccessMessage(`Edge function '${args.slug}' deleted successfully`, result), }, ], }); } catch (error) { const errMsg = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error deleting function: ${errMsg}`, }, ], isError: true, }; } }) );
  • The core handler logic for the 'delete-function' tool: performs a DELETE HTTP request to the API endpoint `/api/functions/{slug}`, handles the response, formats success/error messages, and adds background context.
    withUsageTracking('delete-function', async (args) => { try { const response = await fetch(`${API_BASE_URL}/api/functions/${args.slug}`, { method: 'DELETE', headers: { 'x-api-key': getApiKey(), }, }); const result = await handleApiResponse(response); return await addBackgroundContext({ content: [ { type: 'text', text: formatSuccessMessage(`Edge function '${args.slug}' deleted successfully`, result), }, ], }); } catch (error) { const errMsg = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error deleting function: ${errMsg}`, }, ], isError: true, }; } })
  • Zod input schema defining the required 'slug' parameter as a string.
    { slug: z.string().describe('The slug identifier of the function to delete'), },

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/InsForge/insforge-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server