Skip to main content
Glama
lumile

Promptopia MCP

by lumile

delete_prompt

Remove stored prompts by ID to manage your prompt library in Promptopia MCP.

Instructions

Deletes a prompt by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the prompt to delete

Implementation Reference

  • MCP tool handler execution logic for 'delete_prompt': extracts 'id' from args, calls promptsService.deletePrompt(id), and formats the result as MCP response content.
    case 'delete_prompt': { const { id } = args const result = await this.promptsService.deletePrompt(id) return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] } }
  • Tool registration in listTools(): defines name, description, and inputSchema for 'delete_prompt'.
    { name: 'delete_prompt', description: 'Deletes a prompt by its ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'ID of the prompt to delete' } }, required: ['id'] } },
  • Core deletePrompt method in PromptsService: validates id, checks existence, deletes the JSON file, returns success result.
    async deletePrompt(id: string): Promise<DeletePromptResult> { if (!id || !id.trim()) { throw new ValidationError('Prompt ID is required') } try { // First check if the prompt exists await this.getPrompt(id) // If it exists, delete it const filePath = path.join(this.promptsDir, `${id}.json`) await this.fileSystemService.deleteFile(filePath) return { success: true, message: `Prompt ${id} deleted successfully` } } catch (error) { if (error instanceof Error && error.message.includes('not found')) { throw new NotFoundError(`Prompt not found: ${id}`) } console.error('Failed to delete prompt:', error) throw error } }
  • Type definition for the return value of deletePrompt.
    export interface DeletePromptResult { success: boolean message: string }

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/lumile/promptopia-mcp'

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