create_page
Create a new root-level UI page schema in NocoBase by providing a JSON schema object.
Instructions
Create a new root-level UI schema node in NocoBase
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | UI schema object to create (JSON) |
Implementation Reference
- src/index.ts:86-95 (registration)Registration of the 'create_page' tool via server.registerTool, with inputSchema describing a JSON schema object and a handler that POSTs to /api/uiSchemas.
// 7. create_page server.registerTool( "create_page", { description: "Create a new root-level UI schema node in NocoBase", inputSchema: { schema: JsonObject.describe("UI schema object to create (JSON)") }, }, async ({ schema }) => ok(await nocoFetch("/api/uiSchemas", { method: "POST", body: JSON.stringify(schema) })) ); - src/index.ts:86-95 (handler)The handler for 'create_page' is an inline async function that takes a 'schema' parameter and calls nocoFetch('/api/uiSchemas', { method: 'POST', body: JSON.stringify(schema) }).
// 7. create_page server.registerTool( "create_page", { description: "Create a new root-level UI schema node in NocoBase", inputSchema: { schema: JsonObject.describe("UI schema object to create (JSON)") }, }, async ({ schema }) => ok(await nocoFetch("/api/uiSchemas", { method: "POST", body: JSON.stringify(schema) })) ); - src/index.ts:89-91 (schema)Input schema for 'create_page' uses a reusable JsonObject (z.record(z.string(), z.unknown())) described as 'UI schema object to create (JSON)'.
{ description: "Create a new root-level UI schema node in NocoBase", inputSchema: { schema: JsonObject.describe("UI schema object to create (JSON)") }, - src/index.ts:394-401 (helper)The MANUAL_TOOLS set includes 'create_page' to prevent it from being re-registered by the dynamic OpenAPI tool loader.
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", "get_js_block","update_js_block", ]);