Skip to main content
Glama
tanker327

Prompts MCP Server

by tanker327

delete_prompt

Remove a specific prompt by its name from the Prompts MCP Server, ensuring cleaner prompt management and organization.

Instructions

Delete a prompt by name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the prompt to delete

Implementation Reference

  • The primary handler for the 'delete_prompt' tool. Validates the 'name' argument and delegates the deletion to fileOps.deletePrompt, returning a success message.
    private async handleDeletePrompt(args: ToolArguments): Promise<CallToolResult> { if (!args.name) { throw new Error('Name is required for delete_prompt'); } await this.fileOps.deletePrompt(args.name); return { content: [ { type: 'text', text: `Prompt "${args.name}" deleted successfully`, } as TextContent, ], }; }
  • Tool definition including name, description, and input schema specification for 'delete_prompt'.
    name: 'delete_prompt', description: 'Delete a prompt by name', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the prompt to delete', }, }, required: ['name'], }, },
  • src/tools.ts:144-145 (registration)
    Registration of the handler in the tool call dispatcher switch statement.
    case 'delete_prompt': return await this.handleDeletePrompt(toolArgs);
  • Helper method in PromptFileOperations that performs the actual file deletion for the prompt.
    async deletePrompt(name: string): Promise<boolean> { const fileName = this.sanitizeFileName(name) + '.md'; const filePath = path.join(this.promptsDir, fileName); try { await fs.unlink(filePath); return true; } catch (error) { throw new Error(`Prompt "${name}" not found`); } }

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/tanker327/prompts-mcp-server'

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