Skip to main content
Glama

attach_flow_model

Attach an existing flow model to a parent container at a specific position. Integrate blocks into flowPage layouts.

Instructions

Attach an existing flowPage block/model to a parent. Use this to add an existing block into a flowPage container at a specific position.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidYesFlow model UID to attach
parentIdYesParent flow model UID to attach to
subKeyYesSub-key within the parent (e.g. 'items')
subTypeNoSub-type (e.g. 'array')
positionNoSort position index

Implementation Reference

  • src/index.ts:245-263 (registration)
    Registration of the attach_flow_model tool via server.registerTool() with the name 'attach_flow_model'.
    server.registerTool(
      "attach_flow_model",
      {
        description: "Attach an existing flowPage block/model to a parent. Use this to add an existing block into a flowPage container at a specific position.",
        inputSchema: {
          uid: z.string().describe("Flow model UID to attach"),
          parentId: z.string().describe("Parent flow model UID to attach to"),
          subKey: z.string().describe("Sub-key within the parent (e.g. 'items')"),
          subType: z.string().optional().describe("Sub-type (e.g. 'array')"),
          position: z.number().optional().describe("Sort position index"),
        },
      },
      async ({ uid, parentId, subKey, subType, position }) => {
        const qs = new URLSearchParams({ uid, parentId, subKey });
        if (subType) qs.set("subType", subType);
        if (position !== undefined) qs.set("position", String(position));
        return ok(await nocoFetch(`/api/flowModels:attach?${qs}`, { method: "POST" }));
      }
    );
  • Handler function that builds query params from inputs and calls the nocoFetch helper to POST to /api/flowModels:attach.
    async ({ uid, parentId, subKey, subType, position }) => {
      const qs = new URLSearchParams({ uid, parentId, subKey });
      if (subType) qs.set("subType", subType);
      if (position !== undefined) qs.set("position", String(position));
      return ok(await nocoFetch(`/api/flowModels:attach?${qs}`, { method: "POST" }));
    }
  • Input schema definition with Zod: uid, parentId, subKey (required), subType and position (optional).
    inputSchema: {
      uid: z.string().describe("Flow model UID to attach"),
      parentId: z.string().describe("Parent flow model UID to attach to"),
      subKey: z.string().describe("Sub-key within the parent (e.g. 'items')"),
      subType: z.string().optional().describe("Sub-type (e.g. 'array')"),
      position: z.number().optional().describe("Sort position index"),
    },
  • The nocoFetch helper function used by the handler to make the actual HTTP POST request 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; }
    }
  • The ok helper that wraps the response into MCP content format, used by the handler to return results.
    const ok = (data: unknown) => ({
      content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It only states the basic action of attaching, without disclosing side effects, prerequisites (e.g., does the block need to be unattached?), error behavior, or whether it modifies the parent schema. This lack of behavioral context leaves the agent guessing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no wasted words, front-loaded with the key action. It is appropriately sized for a tool that is conceptually simple.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description should explain what the tool returns (if anything) and error conditions. It only covers purpose and usage. Missing details like behavior on missing UIDs, position handling, and effects on the parent schema make it incomplete for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 5 parameters. The description adds no additional meaning or context beyond what the schema provides, earning the baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool attaches an existing flowPage block/model to a parent at a specific position, using specific verb and resource, and distinguishes from siblings like insert_new_schema and move_flow_model.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context ('Use this to add an existing block into a flowPage container at a specific position'), but does not explicitly exclude alternatives or specify when not to use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/puguhsudarma/nocobase-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server