Skip to main content
Glama

get_js_block

Fetches a JS block UI schema using its UID, designed for classic 'page' type pages.

Instructions

Get a JS block UI schema by UID (for classic 'page' type pages, not flowPage)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidYesUI schema UID of the JS block

Implementation Reference

  • The handler function for get_js_block tool. Fetches a JS block UI schema by UID via /api/uiSchemas/{uid}, extracts the schema data, checks if it's a jsBlock (x-component=CustomRequestBlock or type=jsBlock), and returns a note if it may not be a jsBlock. Returns JSON-stringified data.
    async ({ uid }) => {
      const data = await nocoFetch(`/api/uiSchemas/${uid}`);
      const schema = ((data as { data?: Record<string, unknown> })?.data ?? data) as Record<string, unknown>;
      const note =
        schema?.["x-component"] !== "CustomRequestBlock" && schema?.["type"] !== "jsBlock"
          ? "Note: schema type may not be jsBlock.\n\n"
          : "";
      return { content: [{ type: "text" as const, text: `${note}${JSON.stringify(data, null, 2)}` }] };
    }
  • Input schema for get_js_block: expects a single 'uid' string parameter describing the UI schema UID of the JS block.
    inputSchema: { uid: z.string().describe("UI schema UID of the JS block") },
  • src/index.ts:329-345 (registration)
    Registration of the 'get_js_block' tool using server.registerTool() with description, inputSchema (Zod), and async handler. Also listed in the MANUAL_TOOLS set (line 400) to avoid duplication with dynamic tools from OpenAPI.
    // 22. get_js_block
    server.registerTool(
      "get_js_block",
      {
        description: "Get a JS block UI schema by UID (for classic 'page' type pages, not flowPage)",
        inputSchema: { uid: z.string().describe("UI schema UID of the JS block") },
      },
      async ({ uid }) => {
        const data = await nocoFetch(`/api/uiSchemas/${uid}`);
        const schema = ((data as { data?: Record<string, unknown> })?.data ?? data) as Record<string, unknown>;
        const note =
          schema?.["x-component"] !== "CustomRequestBlock" && schema?.["type"] !== "jsBlock"
            ? "Note: schema type may not be jsBlock.\n\n"
            : "";
        return { content: [{ type: "text" as const, text: `${note}${JSON.stringify(data, null, 2)}` }] };
      }
    );
Behavior3/5

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

No annotations are provided, so the description carries full burden. It correctly indicates a read operation ('Get') with no mention of side effects. However, it lacks details on authentication, rate limits, or error conditions, which are not critical for a simple getter but would add transparency.

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 a single, front-loaded sentence with no unnecessary words. It efficiently conveys purpose and context.

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 (one parameter, no output schema), the description is mostly complete. It explains the return (UI schema) implicitly through the verb 'Get'. Could be improved by explicitly stating the return format, but not essential.

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% for the single parameter 'uid', which the schema describes as 'UI schema UID of the JS block'. The description adds no further semantics beyond the schema, so baseline 3 is appropriate.

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 verb 'Get', the resource 'JS block UI schema', and the method 'by UID'. It also distinguishes from sibling tools by specifying it is for 'classic page type pages, not flowPage', which is a clear qualifier.

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 explicit context for when to use the tool, i.e., for classic page type pages, and explicitly excludes flowPage. This helps the agent decide when to use this tool versus others like get_flow_model, though no alternative tool names are given.

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