Skip to main content
Glama

delete-function

Remove an edge function permanently from the Insforge MCP Server using its slug identifier. This tool helps manage serverless functions by deleting unwanted or outdated deployments.

Instructions

Delete an edge function permanently

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesThe slug identifier of the function to delete

Implementation Reference

  • Handler implementation for the 'delete-function' tool. It sends a DELETE request to the backend API endpoint `/api/functions/{slug}` to delete the specified edge function, handles the response, and formats the output with background context and error handling.
    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, }; } }) );
  • Input schema for the 'delete-function' tool, defining the required 'slug' parameter as a string.
    { slug: z.string().describe('The slug identifier of the function to delete'), },
  • Registration of the 'delete-function' MCP tool on the server, including name, description, input schema, and handler function.
    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, }; } }) );

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