remove_ui_schema
Delete a UI schema node and all its descendants by providing its UID. Irreversible.
Instructions
Remove a UI schema node and all its descendants by UID. DESTRUCTIVE — cannot be undone.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | UI schema UID to remove |
Implementation Reference
- src/index.ts:153-162 (registration)Registration of the 'remove_ui_schema' tool with server.registerTool, including its description, input schema (uid: z.string()), and handler that makes a DELETE request to /api/uiSchemas:remove/{uid}.
// 12. remove_ui_schema server.registerTool( "remove_ui_schema", { description: "Remove a UI schema node and all its descendants by UID. DESTRUCTIVE — cannot be undone.", inputSchema: { uid: z.string().describe("UI schema UID to remove") }, }, async ({ uid }) => ok(await nocoFetch(`/api/uiSchemas:remove/${uid}`, { method: "DELETE" })) ); - src/index.ts:160-161 (handler)The inline async handler for remove_ui_schema: calls nocoFetch with DELETE method on the uiSchemas:remove endpoint.
async ({ uid }) => ok(await nocoFetch(`/api/uiSchemas:remove/${uid}`, { method: "DELETE" })) - src/index.ts:158-158 (schema)Input schema for remove_ui_schema: a single required 'uid' string field.
inputSchema: { uid: z.string().describe("UI schema UID to remove") }, - src/index.ts:18-27 (helper)The nocoFetch helper used by the handler to make the HTTP DELETE request to the backend API.
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; } }