Skip to main content
Glama
lumile

Promptopia MCP

by lumile

delete_prompt

Remove unwanted prompts by specifying their unique ID using this tool, ensuring clean and organized prompt management on Promptopia MCP.

Instructions

Deletes a prompt by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the prompt to delete

Implementation Reference

  • The handler logic for the 'delete_prompt' tool. Extracts the 'id' from input arguments, delegates deletion to PromptsService, and returns the result formatted as MCP tool 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) }] } }
  • Type definition for the output of deletePrompt operation, used by the service and handler.
    export interface DeletePromptResult { success: boolean message: string }
  • Registers the 'delete_prompt' tool in the listTools() method, including its description and input schema requiring a string 'id'.
    { 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 implementation of prompt deletion in PromptsService: validates ID, checks existence, deletes the JSON file from filesystem, handles errors, and 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 } }

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

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