delete_prompt
Delete a prompt and all its versions by prompt ID. Irreversible action that breaks callers using the slug; confirm removal with list_prompt_versions first.
Instructions
Delete a prompt and all its versions by id. This cannot be undone, immediately breaks callers using the slug, and should only be used after checking list_prompt_versions or confirming you do not need an audit trail.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt_id | Yes | Prompt ID or slug to delete |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |
Implementation Reference
- src/tools/prompts.tools.ts:726-749 (registration)Registration of the 'delete_prompt' tool on the MCP server. Binds the schema and handler logic together.
// Delete prompt tool server.tool( "delete_prompt", "Delete a prompt and all its versions by id. This cannot be undone, immediately breaks callers using the slug, and should only be used after checking list_prompt_versions or confirming you do not need an audit trail.", PROMPTS_TOOL_SCHEMAS.deletePrompt, async (params) => { await service.prompts.deletePrompt(params.prompt_id); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully deleted prompt "${params.prompt_id}"`, success: true, }, null, 2, ), }, ], }; }, ); - src/tools/prompts.tools.ts:731-748 (handler)Handler function for delete_prompt. Calls service.prompts.deletePrompt and returns a success message.
async (params) => { await service.prompts.deletePrompt(params.prompt_id); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully deleted prompt "${params.prompt_id}"`, success: true, }, null, 2, ), }, ], }; }, - src/tools/prompts.tools.ts:179-181 (schema)Zod schema for the deletePrompt tool; expects a single 'prompt_id' string parameter.
deletePrompt: { prompt_id: z.string().describe("Prompt ID or slug to delete"), }, - deletePrompt method on the PromptsService; performs DELETE /prompts/{promptId} HTTP request.
async deletePrompt(promptId: string): Promise<DeletePromptResponse> { return this.delete<DeletePromptResponse>( `/prompts/${this.encodePathSegment(promptId)}`, ); } - Type definition for DeletePromptResponse: an empty object (Record<string, never>).
export type DeletePromptResponse = Record<string, never>;