Skip to main content
Glama

delete_prompt

Destructive

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

TableJSON Schema
NameRequiredDescriptionDefault
prompt_idYesPrompt ID or slug to delete

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false

Implementation Reference

  • 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,
    					),
    				},
    			],
    		};
    	},
    );
  • 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,
    				),
    			},
    		],
    	};
    },
  • 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>;
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark destructiveHint=true and readOnlyHint=false. The description adds specific behavioral context: 'This cannot be undone, immediately breaks callers using the slug,' which goes beyond annotations. However, it does not detail any rate limits or permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no unnecessary words. It front-loads the core action ('Delete a prompt...'), then adds critical caveats. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive one-parameter tool with an output schema, the description covers what is deleted, irreversibility, impact on callers, and prerequisite checks. It is complete given the tool's simplicity and the presence of annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage for the single parameter 'prompt_id' with a clear description ('Prompt ID or slug to delete'). The tool description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: 'Delete a prompt and all its versions by id.' It uses a specific verb ('Delete') and resource ('prompt and all its versions'), distinguishing it from sibling tools like 'delete_prompt_label' or 'delete_prompt_partial'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance: 'should only be used after checking list_prompt_versions or confirming you do not need an audit trail.' It warns about irreversibility and impact on callers ('immediately breaks callers using the slug'), helping decide when to use this tool versus alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/s-b-e-n-s-o-n/portkey-admin-mcp'

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