delete_program_edition
Remove a program edition from the system by providing its ID. This action permanently deletes the specified edition.
Instructions
Delete a program edition
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the program edition to delete |
Implementation Reference
- src/tools/program_editions.ts:143-159 (handler)Handler registration for the 'delete_program_edition' tool. Registers the tool with server.registerTool, calling apiDelete('/program/editions/${id}') and formatting the result with formatDelete.
server.registerTool( "delete_program_edition", { description: "Delete a program edition", annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the program edition to delete") }, }, async ({ id }) => { try { const record = await apiDelete<EduframeRecord>(`/program/editions/${id}`); void logResponse("delete_program_edition", { id }, record); return formatDelete(record, "program edition"); } catch (error) { return formatError(error); } }, ); - Input schema for delete_program_edition: requires a positive integer 'id' field.
inputSchema: { id: z.number().int().positive().describe("ID of the program edition to delete") }, - src/tools/index.ts:111-111 (registration)The registerProgramEditionTools function is included in the global tools registration list in tools/index.ts, called when registerAllTools() runs.
registerProgramEditionTools, - src/api.ts:219-229 (helper)The apiDelete helper function used by the handler to perform an HTTP DELETE request to the Eduframe API.
export async function apiDelete<T>(path: string): Promise<T> { const { token } = getConfig(); const url = buildUrl(path); const response = await fetch(url.toString(), { method: "DELETE", headers: buildHeaders(token), }); return handleResponse<T>(response); } - src/formatters.ts:119-128 (helper)The formatDelete helper used by the handler to format the API response into a human-readable success message.
export function formatDelete(record: EduframeRecord, resourceName: string): CallToolResult { return { content: [ { type: "text", text: `Successfully deleted ${resourceName}:\n\n${formatJSON(record)}${RESPONSE_LOG_HINT}`, }, ], }; }