get_flow_model_by_parent
Retrieve a flow page block by parent ID and sub-key to navigate the block tree.
Instructions
Get a flowPage block/model by its parent ID and subKey. Useful for navigating the flowPage block tree.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parentId | Yes | Parent flow model UID | |
| subKey | No | Sub-key within the parent (e.g. 'items') | |
| includeAsyncNode | No | Whether to include async node data (default false) |
Implementation Reference
- src/index.ts:212-228 (registration)The tool 'get_flow_model_by_parent' is registered using server.registerTool with input schema for parentId (required), subKey (optional), and includeAsyncNode (optional). The handler constructs a query string and calls the NocoBase API endpoint /api/flowModels:findOne.
// 16. get_flow_model_by_parent server.registerTool( "get_flow_model_by_parent", { description: "Get a flowPage block/model by its parent ID and subKey. Useful for navigating the flowPage block tree.", inputSchema: { parentId: z.string().describe("Parent flow model UID"), subKey: z.string().optional().describe("Sub-key within the parent (e.g. 'items')"), includeAsyncNode: z.boolean().optional().describe("Whether to include async node data (default false)"), }, }, async ({ parentId, subKey, includeAsyncNode = false }) => { const qs = new URLSearchParams({ parentId, includeAsyncNode: String(includeAsyncNode) }); if (subKey) qs.set("subKey", subKey); return ok(await nocoFetch(`/api/flowModels:findOne?${qs}`)); } ); - src/index.ts:216-221 (schema)Schema/input validation for get_flow_model_by_parent: parentId is a required string, subKey is optional string, includeAsyncNode is optional boolean.
description: "Get a flowPage block/model by its parent ID and subKey. Useful for navigating the flowPage block tree.", inputSchema: { parentId: z.string().describe("Parent flow model UID"), subKey: z.string().optional().describe("Sub-key within the parent (e.g. 'items')"), includeAsyncNode: z.boolean().optional().describe("Whether to include async node data (default false)"), }, - src/index.ts:223-228 (handler)Handler function for get_flow_model_by_parent: builds query parameters (parentId, includeAsyncNode, optionally subKey) and fetches from the flowModels:findOne API endpoint.
async ({ parentId, subKey, includeAsyncNode = false }) => { const qs = new URLSearchParams({ parentId, includeAsyncNode: String(includeAsyncNode) }); if (subKey) qs.set("subKey", subKey); return ok(await nocoFetch(`/api/flowModels:findOne?${qs}`)); } ); - src/index.ts:29-31 (helper)The 'ok' helper utility wraps data into the MCP content response format used by the handler.
const ok = (data: unknown) => ({ content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], });