delete_custom_record
Delete a custom record by specifying the parent resource ID and the record ID.
Instructions
Delete a custom record
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| object_slug | Yes | ID of the parent resource | |
| id | Yes | ID of the custom record to delete |
Implementation Reference
- src/tools/custom_records.ts:89-97 (handler)The handler function for the delete_custom_record tool. It calls apiDelete with the path /custom/objects/{object_slug}/records/{record_id}, logs the response, and formats the result using formatDelete. Note: Line 91 has a bug - it uses 'record_id' instead of 'id'.
async ({ object_slug, id }) => { try { const record = await apiDelete<EduframeRecord>(`/custom/objects/${object_slug}/records/${record_id}`); void logResponse("delete_custom_record", { object_slug, id }, record); return formatDelete(record, "custom record"); } catch (error) { return formatError(error); } }, - src/tools/custom_records.ts:84-87 (schema)Input schema for delete_custom_record: requires object_slug (positive int, ID of parent resource) and id (positive int, ID of custom record to delete).
inputSchema: { object_slug: z.number().int().positive().describe("ID of the parent resource"), id: z.number().int().positive().describe("ID of the custom record to delete"), }, - src/tools/custom_records.ts:79-98 (registration)Registration of delete_custom_record tool on the MCP server via registerTool() with description and annotations (destructiveHint: true).
server.registerTool( "delete_custom_record", { description: "Delete a custom record", annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true }, inputSchema: { object_slug: z.number().int().positive().describe("ID of the parent resource"), id: z.number().int().positive().describe("ID of the custom record to delete"), }, }, async ({ object_slug, id }) => { try { const record = await apiDelete<EduframeRecord>(`/custom/objects/${object_slug}/records/${record_id}`); void logResponse("delete_custom_record", { object_slug, id }, record); return formatDelete(record, "custom record"); } catch (error) { return formatError(error); } }, ); - src/tools/index.ts:20-83 (registration)Import of registerCustomRecordTools from custom_records.ts, which registers delete_custom_record along with other custom record tools.
import { registerCustomRecordTools } from "./custom_records"; import { registerDiscountCodeTools } from "./discount_codes"; import { registerEditionDescriptionSectionTools } from "./edition_description_sections"; import { registerEducatorTools } from "./educators"; import { registerEmailTools } from "./emails"; import { registerEnrollmentTools } from "./enrollments"; import { registerGradeTools } from "./grades"; import { registerInvoiceVatTools } from "./invoice_vats"; import { registerInvoiceTools } from "./invoices"; import { registerLabelTools } from "./labels"; import { registerLeadTools } from "./leads"; import { registerMaterialGroupTools } from "./material_groups"; import { registerMaterialTools } from "./materials"; import { registerMeetingLocationTools } from "./meeting_locations"; import { registerMeetingTools } from "./meetings"; import { registerOrderTools } from "./orders"; import { registerOrganizationTools } from "./organizations"; import { registerPaymentMethodTools } from "./payment_methods"; import { registerPaymentOptionTools } from "./payment_options"; import { registerPaymentTools } from "./payments"; import { registerPlannedCourseTools } from "./planned_courses"; import { registerPlanningAttendeeTools } from "./planning_attendees"; import { registerPlanningConflictTools } from "./planning_conflicts"; import { registerPlanningEventTools } from "./planning_events"; import { registerPlanningLocationTools } from "./planning_locations"; import { registerPlanningMaterialTools } from "./planning_materials"; import { registerPlanningRequiredTeacherGroupAttendeeTools } from "./planning_required_teacher_group_attendees"; import { registerPlanningTeacherTools } from "./planning_teachers"; import { registerProgramEditionTools } from "./program_editions"; import { registerProgramElementTools } from "./program_elements"; import { registerProgramEnrollmentTools } from "./program_enrollments"; import { registerProgramPersonalProgramElementTools } from "./program_personal_program_elements"; import { registerProgramProgramTools } from "./program_programs"; import { registerReferralTools } from "./referrals"; import { registerSignupQuestionTools } from "./signup_questions"; import { registerTaskTools } from "./tasks"; import { registerTeacherEnrollmentTools } from "./teacher_enrollments"; import { registerTeacherRoleTools } from "./teacher_roles"; import { registerTeacherTools } from "./teachers"; import { registerTheseTools } from "./theses"; import { registerUserTools } from "./users"; import { registerWebhookNotificationTools } from "./webhook_notifications"; import { registerWebhookTools } from "./webhooks"; const tools: Array<(server: McpServer) => void> = [ registerAccountTools, registerAffiliationTools, registerAttendanceTools, registerAuthenticationTools, registerCatalogProductTools, registerCatalogVariantTools, registerCategorieTools, registerCertificateTools, registerCommentTools, registerCourseLocationTools, registerCourseTabTools, registerCourseVariantTools, registerCourseTools, registerCreditCategorieTools, registerCreditTools, registerCustomAssociationTools, registerCustomFieldOptionTools, registerCustomObjectTools, registerCustomRecordTools, - src/api.ts:219-229 (helper)The apiDelete function used by the handler to perform DELETE HTTP requests 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); }