Skip to main content
Glama

delete_function

Remove a custom MCP function by specifying its name, ensuring clean management of AI-generated tools within the AI Meta MCP Server's meta-function architecture.

Instructions

Delete a custom MCP function

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the function to delete

Implementation Reference

  • The handler function that implements the logic for the 'delete_function' tool. It verifies the existence of the custom tool by name, removes it from the customTools registry if found, persists the change to the tools database, and returns a success or error response in MCP format.
    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)}`, }, ], }; } }
  • The input schema definition for the 'delete_function' tool, specifying a required 'name' parameter as a non-empty string with description.
    { name: z.string().min(1).describe("Name of the function to delete"), },
  • src/index.ts:410-457 (registration)
    The registration of the 'delete_function' tool with the MCP server using server.tool(), including the tool name, description, input schema, and handler function.
    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)}`, }, ], }; } } );

Other Tools

Related 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