Skip to main content
Glama

batch_patch_ui_schema

Update multiple UI schema nodes in a single request by providing an array of patch objects, each identified by x-uid with the fields to update.

Instructions

Patch multiple UI schema nodes in a single request. Each object in the patches array must include 'x-uid' plus the fields to update.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patchesYesArray of partial schema patch objects, each identified by x-uid

Implementation Reference

  • src/index.ts:141-151 (registration)
    Registration of the 'batch_patch_ui_schema' tool using server.registerTool, with description and inputSchema.
    server.registerTool(
      "batch_patch_ui_schema",
      {
        description: "Patch multiple UI schema nodes in a single request. Each object in the patches array must include 'x-uid' plus the fields to update.",
        inputSchema: {
          patches: z.array(JsonObject).describe("Array of partial schema patch objects, each identified by x-uid"),
        },
      },
      async ({ patches }) =>
        ok(await nocoFetch("/api/uiSchemas:batchPatch", { method: "POST", body: JSON.stringify(patches) }))
    );
  • Handler function that calls nocoFetch('/api/uiSchemas:batchPatch') with a POST method and the serialized patches array.
      async ({ patches }) =>
        ok(await nocoFetch("/api/uiSchemas:batchPatch", { method: "POST", body: JSON.stringify(patches) }))
    );
  • Input schema defining a 'patches' parameter as an array of JSON objects.
      description: "Patch multiple UI schema nodes in a single request. Each object in the patches array must include 'x-uid' plus the fields to update.",
      inputSchema: {
        patches: z.array(JsonObject).describe("Array of partial schema patch objects, each identified by x-uid"),
      },
    },
  • The JsonObject helper schema (z.record(z.string(), z.unknown())) reused for the patches array element type.
    const JsonObject = z.record(z.string(), z.unknown());
  • The nocoFetch helper function used by the handler to make HTTP requests.
    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; }
    }
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It states the tool patches multiple nodes, but does not describe side effects (e.g., whether it replaces or merges fields), authentication needs, rate limits, or error behavior. This is insufficient for a mutation tool.

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

Conciseness4/5

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

The description is a single sentence plus a brief instruction, making it concise and front-loaded. However, the instruction could be integrated more naturally; it feels slightly tacked on. Still, every sentence earns its place.

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

Completeness4/5

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

Given the tool's simplicity (1 parameter, no output schema, no annotations), the description covers the essential purpose and a critical usage constraint. It does not explain return values or limits on batch size, but these are not strictly necessary for a basic tool. Overall, it is fairly complete.

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 coverage is 100% with a description for 'patches', but the schema itself is very permissive (additionalProperties: {}). The description adds the key constraint that each object must include 'x-uid', which is not enforced by the schema. Beyond that, no additional semantics are provided for the parameter structure.

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 specifies the verb 'patch' and the resource 'UI schema nodes', and explicitly states it operates on 'multiple' nodes in a single request. This distinguishes it from sibling tools like 'update_ui_schema' which likely handles single nodes.

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

Usage Guidelines3/5

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

The description provides the requirement that each object must include 'x-uid' plus fields, which guides usage. However, it does not explicitly state when to use this tool versus the alternative 'update_ui_schema' for single updates, nor does it mention any preconditions or when not to use it.

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