delete_course_location
Delete a course location by its ID, permanently removing it from your system.
Instructions
Delete a course location.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the course location to delete |
Implementation Reference
- src/tools/course_locations.ts:122-138 (handler)Handler registration for the 'delete_course_location' tool. Calls apiDelete on /course_locations/{id}, logs the response, and returns a formatted delete result.
server.registerTool( "delete_course_location", { description: "Delete a course location.", annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true }, inputSchema: { id: z.number().int().positive().describe("ID of the course location to delete") }, }, async ({ id }) => { try { const record = await apiDelete<EduframeRecord>(`/course_locations/${id}`); void logResponse("delete_course_location", { id }, record); return formatDelete(record, "course location"); } catch (error) { return formatError(error); } }, ); - Input schema for delete_course_location: requires a positive integer 'id'.
inputSchema: { id: z.number().int().positive().describe("ID of the course location to delete") }, - src/tools/course_locations.ts:15-15 (registration)Function that registers all course location tools (including delete_course_location) on the MCP server.
export function registerCourseLocationTools(server: McpServer): void { - src/tools/index.ts:64-132 (registration)registerCourseLocationTools is included in the aggregated list of all tool registrations, called by registerAllTools.
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, registerDiscountCodeTools, registerEditionDescriptionSectionTools, registerEducatorTools, registerEmailTools, registerEnrollmentTools, registerGradeTools, registerInvoiceVatTools, registerInvoiceTools, registerLabelTools, registerLeadTools, registerMaterialGroupTools, registerMaterialTools, registerMeetingLocationTools, registerMeetingTools, registerOrderTools, registerOrganizationTools, registerPaymentMethodTools, registerPaymentOptionTools, registerPaymentTools, registerPlannedCourseTools, registerPlanningAttendeeTools, registerPlanningConflictTools, registerPlanningEventTools, registerPlanningLocationTools, registerPlanningMaterialTools, registerPlanningRequiredTeacherGroupAttendeeTools, registerPlanningTeacherTools, registerProgramEditionTools, registerProgramElementTools, registerProgramEnrollmentTools, registerProgramPersonalProgramElementTools, registerProgramProgramTools, registerReferralTools, registerSignupQuestionTools, registerTaskTools, registerTeacherEnrollmentTools, registerTeacherRoleTools, registerTeacherTools, registerTheseTools, registerUserTools, registerWebhookNotificationTools, registerWebhookTools, ]; export function registerAllTools(server: McpServer): void { for (const register of tools) { register(server); } } - src/api.ts:219-229 (helper)Helper function that performs the HTTP DELETE request used by the delete_course_location handler.
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); }