get_flow_model
Retrieve a flowPage block's model by its UID, including component type, parentId, and stepParams. Use this for blocks inside flowPage type pages.
Instructions
Get a flowPage block/model by UID. Use this for blocks inside flowPage type pages (not classic 'page' type). Returns the block's model data including 'use' (component type), 'parentId', 'stepParams', etc.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Flow model UID (from 'Copy UID' on a block inside a flowPage) | |
| includeAsyncNode | No | Whether to include async node data (default false) |
Implementation Reference
- src/index.ts:199-210 (handler)The handler for 'get_flow_model' — calls server.registerTool with name 'get_flow_model', an input schema requiring 'uid' (string) and optional 'includeAsyncNode' (boolean), and an async handler that fetches from /api/flowModels:findOne with those parameters.
server.registerTool( "get_flow_model", { description: "Get a flowPage block/model by UID. Use this for blocks inside flowPage type pages (not classic 'page' type). Returns the block's model data including 'use' (component type), 'parentId', 'stepParams', etc.", inputSchema: { uid: z.string().describe("Flow model UID (from 'Copy UID' on a block inside a flowPage)"), includeAsyncNode: z.boolean().optional().describe("Whether to include async node data (default false)"), }, }, async ({ uid, includeAsyncNode = false }) => ok(await nocoFetch(`/api/flowModels:findOne?uid=${uid}&includeAsyncNode=${includeAsyncNode}`)) ); - src/index.ts:199-210 (registration)Registration of 'get_flow_model' via server.registerTool(). The tool is also listed in the MANUAL_TOOLS set (line 398) to prevent duplication from dynamic OpenAPI/Swagger tool loading.
server.registerTool( "get_flow_model", { description: "Get a flowPage block/model by UID. Use this for blocks inside flowPage type pages (not classic 'page' type). Returns the block's model data including 'use' (component type), 'parentId', 'stepParams', etc.", inputSchema: { uid: z.string().describe("Flow model UID (from 'Copy UID' on a block inside a flowPage)"), includeAsyncNode: z.boolean().optional().describe("Whether to include async node data (default false)"), }, }, async ({ uid, includeAsyncNode = false }) => ok(await nocoFetch(`/api/flowModels:findOne?uid=${uid}&includeAsyncNode=${includeAsyncNode}`)) ); - src/index.ts:18-27 (helper)The nocoFetch helper function used by the get_flow_model handler to make HTTP requests to the NocoBase API. It constructs the full URL, adds auth headers, and parses the JSON response.
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; } } - src/index.ts:29-31 (helper)The ok helper function that wraps data into the MCP content response format used by the get_flow_model handler.
const ok = (data: unknown) => ({ content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], });