Skip to main content
Glama
InsForge

Insforge MCP Server

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,
          };
        }
      })
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'permanently', which hints at irreversibility, but fails to address critical aspects like required permissions, error handling (e.g., what happens if the slug doesn't exist), or confirmation prompts. This leaves significant gaps for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with no wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a destructive tool with no annotations and no output schema, the description is insufficient. It lacks details on permissions, side effects, error responses, or what happens post-deletion. For a tool that permanently deletes resources, more context is needed to ensure safe usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents the 'slug' parameter adequately. The description adds no additional meaning beyond what's in the schema, such as format examples or context about where to find the slug. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and resource ('an edge function'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'delete-bucket' or 'update-function' beyond the resource name, which is why it doesn't reach a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'update-function' or what prerequisites might be needed (e.g., checking if the function exists first). It only states what the tool does, not when or why to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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