list_pages
List all UI schemas in NocoBase, returning raw schema nodes for direct access to the schema structure, not page-level navigation.
Instructions
List all UI schemas in NocoBase (returns raw schema nodes, not page-level navigation)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:63-63 (handler)The async handler function that executes the 'list_pages' tool logic by calling nocoFetch('/api/uiSchemas') and formatting the result via ok().
async () => ok(await nocoFetch("/api/uiSchemas")) - src/index.ts:62-62 (schema)The description/inputSchema for list_pages (no input parameters defined).
{ description: "List all UI schemas in NocoBase (returns raw schema nodes, not page-level navigation)" }, - src/index.ts:60-64 (registration)Registration of the 'list_pages' tool via server.registerTool() with name, description, and handler.
server.registerTool( "list_pages", { description: "List all UI schemas in NocoBase (returns raw schema nodes, not page-level navigation)" }, async () => ok(await nocoFetch("/api/uiSchemas")) ); - src/index.ts:18-27 (helper)The nocoFetch helper used by the handler to make HTTP requests to the NocoBase 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; } } - src/index.ts:29-31 (helper)The ok helper used by the handler to wrap results in MCP content format.
const ok = (data: unknown) => ({ content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }], });