delete_prompt_partial
Delete a prompt partial by its ID. This action is permanent; prompts using this partial will fail to render until the reference is replaced.
Instructions
Delete a prompt partial by ID. This cannot be undone, and prompts that reference it with {{> name}} will fail to render until you replace the reference.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt_partial_id | Yes | Prompt partial 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/partials.tools.ts:198-221 (handler)The MCP tool handler for 'delete_prompt_partial'. It registers the tool with server.tool(), takes prompt_partial_id as input, calls service.partials.deletePromptPartial(), and returns a success message.
// Delete partial tool server.tool( "delete_prompt_partial", "Delete a prompt partial by ID. This cannot be undone, and prompts that reference it with {{> name}} will fail to render until you replace the reference.", PARTIALS_TOOL_SCHEMAS.deletePromptPartial, async (params) => { await service.partials.deletePromptPartial(params.prompt_partial_id); return { content: [ { type: "text", text: JSON.stringify( { message: `Successfully deleted prompt partial "${params.prompt_partial_id}"`, success: true, }, null, 2, ), }, ], }; }, ); - src/tools/partials.tools.ts:45-49 (schema)Zod input schema for deletePromptPartial — defines the single required parameter prompt_partial_id (string) for the tool.
deletePromptPartial: { prompt_partial_id: z .string() .describe("Prompt partial ID or slug to delete"), }, - src/tools/partials.tools.ts:64-67 (registration)The registerPartialsTools function is the registration entry point. It is called from the central tool registration system in src/tools/index.ts (line 42).
export function registerPartialsTools( server: McpServer, service: PortkeyService, ): void { - src/tools/index.ts:30-49 (registration)Central tool registration array (TOOL_DOMAIN_REGISTRARS) that maps 'partials' domain to registerPartialsTools, wired up in registerAllTools().
const TOOL_DOMAIN_REGISTRARS = [ ["users", registerUsersTools], ["workspaces", registerWorkspacesTools], ["configs", registerConfigsTools], ["keys", registerKeysTools], ["collections", registerCollectionsTools], ["prompts", registerPromptsTools], ["analytics", registerAnalyticsTools], ["guardrails", registerGuardrailsTools], ["limits", registerLimitsTools], ["audit", registerAuditTools], ["labels", registerLabelsTools], ["partials", registerPartialsTools], ["tracing", registerTracingTools], ["logging", registerLoggingTools], ["providers", registerProvidersTools], ["integrations", registerIntegrationsTools], ["mcp-integrations", registerMcpIntegrationsTools], ["mcp-servers", registerMcpServersTools], ] as const satisfies readonly (readonly [string, ToolRegistrar])[]; - The service-layer deletePromptPartial method, which sends an HTTP DELETE to /prompts/partials/{prompt_partial_id} via the BaseService.delete() helper.
async deletePromptPartial( promptPartialId: string, ): Promise<DeletePromptPartialResponse> { return this.delete<DeletePromptPartialResponse>( `/prompts/partials/${this.encodePathSegment(promptPartialId)}`, ); }