Skip to main content
Glama
alxspiker

AI Meta MCP Server

delete_function

Remove a custom MCP function by name to manage the AI Meta MCP Server's dynamic toolset.

Instructions

Delete a custom MCP function

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the function to delete

Implementation Reference

  • The handler function for the 'delete_function' tool. It checks if the specified function exists in the customTools object, deletes it if it does, saves the tools database, and returns appropriate success or error responses.
    async ({ name }) => {
      console.error(`Deleting function: ${name}`);
      
      // Check if function exists
      if (!customTools[name]) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `No function named "${name}" exists.`,
            },
          ],
        };
      }
    
      // Delete the tool
      try {
        delete customTools[name];
        await saveToolsDatabase();
    
        return {
          content: [
            {
              type: "text",
              text: `Successfully deleted function "${name}".`,
            },
          ],
        };
      } catch (error) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error deleting function: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    }
  • Input schema for the 'delete_function' tool, defining the 'name' parameter using Zod validation.
    {
      name: z.string().min(1).describe("Name of the function to delete"),
    },
  • src/index.ts:410-457 (registration)
    Registration of the 'delete_function' tool on the MCP server using server.tool(), specifying name, description, input schema, and handler.
    server.tool(
      "delete_function",
      "Delete a custom MCP function",
      {
        name: z.string().min(1).describe("Name of the function to delete"),
      },
      async ({ name }) => {
        console.error(`Deleting function: ${name}`);
        
        // Check if function exists
        if (!customTools[name]) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: `No function named "${name}" exists.`,
              },
            ],
          };
        }
    
        // Delete the tool
        try {
          delete customTools[name];
          await saveToolsDatabase();
    
          return {
            content: [
              {
                type: "text",
                text: `Successfully deleted function "${name}".`,
              },
            ],
          };
        } catch (error) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: `Error deleting function: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Delete' implies a destructive mutation, the description doesn't specify whether this action is reversible, requires specific permissions, or has side effects (e.g., breaking dependencies). It also doesn't describe the response format or error conditions, leaving significant behavioral gaps.

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, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable and efficient. Every word earns its place by conveying essential information without redundancy.

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 the tool's destructive nature and lack of annotations or output schema, the description is incomplete. It doesn't address critical context like irreversible deletion, permission requirements, error handling, or what happens upon success. For a mutation tool with no structured safety hints, more behavioral detail is needed to guide the agent effectively.

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 input schema has 100% description coverage, with the 'name' parameter fully documented in the schema itself. The description adds no additional parameter semantics beyond what the schema provides (e.g., format examples, validation rules, or edge cases). Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the specific action ('Delete') and the resource ('a custom MCP function'), making the purpose immediately understandable. It distinguishes this tool from its siblings (define_function, get_function_details, list_functions, update_function) by focusing on the deletion operation rather than creation, retrieval, listing, or modification.

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. It doesn't mention prerequisites (e.g., the function must exist), consequences (e.g., irreversible deletion), or when to choose delete_function over update_function for removing functionality. Without such context, the agent lacks usage direction.

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/alxspiker/ai-meta-mcp-server'

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