destroy_flow_model
Delete a flow model and all its child blocks by specifying the model's UID.
Instructions
Delete a flowPage block/model by UID. DESTRUCTIVE — also removes child blocks.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Flow model UID to delete |
Implementation Reference
- src/index.ts:314-325 (handler)Handler for destroy_flow_model tool. Deletes a flowPage block/model by UID via POST to /api/flowModels:destroy?filterByTk=${uid}.
// 21. destroy_flow_model server.registerTool( "destroy_flow_model", { description: "Delete a flowPage block/model by UID. DESTRUCTIVE — also removes child blocks.", inputSchema: { uid: z.string().describe("Flow model UID to delete"), }, }, async ({ uid }) => ok(await nocoFetch(`/api/flowModels:destroy?filterByTk=${uid}`, { method: "DELETE" })) ); - src/index.ts:319-321 (schema)Input schema for destroy_flow_model: requires a uid (string) describing the flow model UID to delete.
inputSchema: { uid: z.string().describe("Flow model UID to delete"), }, - src/index.ts:394-399 (registration)Registration: destroy_flow_model is listed in the MANUAL_TOOLS set to explicitly exclude it from dynamic OpenAPI-based tool generation.
const MANUAL_TOOLS = new Set([ "list_collections","get_collection","list_pages","get_page", "get_parent_schema","create_page","insert_new_schema","insert_adjacent_schema", "update_ui_schema","batch_patch_ui_schema","remove_ui_schema","save_as_template", "list_desktop_routes","get_flow_model","get_flow_model_by_parent","save_flow_model", "attach_flow_model","move_flow_model","duplicate_flow_model","destroy_flow_model", - src/index.ts:18-27 (helper)The nocoFetch helper function is used by destroy_flow_model to make the DELETE API call.
async function nocoFetch(path: string, options: RequestInit = {}): Promise<unknown> { const url = `${NOCOBASE_URL}${path}`; const res = await fetch(url, { ...options, headers: { ...reqHeaders, ...(options.headers as Record<string, string> | undefined) }, }); const text = await res.text(); if (!res.ok) throw new Error(`HTTP ${res.status} ${res.statusText}: ${text}`); try { return JSON.parse(text); } catch { return text; } }