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
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | The slug identifier of the function to delete |
Implementation Reference
- src/shared/tools.ts:993-1031 (registration)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, }; } }) );
- src/shared/tools.ts:999-1030 (handler)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, }; } })
- src/shared/tools.ts:996-998 (schema)Zod input schema defining the required 'slug' parameter as a string.{ slug: z.string().describe('The slug identifier of the function to delete'), },