Skip to main content
Glama

list_collections

Retrieve a list of all collections defined in your NocoBase instance.

Instructions

List all collections in NocoBase

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool 'list_collections' is registered via server.registerTool with name 'list_collections'. Its handler is an async function that calls nocoFetch('/api/collections') to list all collections in NocoBase and wraps the result with the ok() helper.
    server.registerTool(
      "list_collections",
      { description: "List all collections in NocoBase" },
      async () => ok(await nocoFetch("/api/collections"))
    );
  • src/index.ts:41-45 (registration)
    Same code block — this is also where the tool is registered on the MCP server using 'server.registerTool("list_collections", ...)'.
    server.registerTool(
      "list_collections",
      { description: "List all collections in NocoBase" },
      async () => ok(await nocoFetch("/api/collections"))
    );
  • The schema/description for 'list_collections' is simply { description: 'List all collections in NocoBase' } with no input parameters (no inputSchema).
    { description: "List all collections in NocoBase" },
  • The 'ok' helper function wraps data into the MCP content response format: { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }.
    const ok = (data: unknown) => ({
      content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
    });
  • The 'nocoFetch' helper is used by the handler to make authenticated HTTP requests to the NocoBase API at /api/collections.
    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; }
    }
Behavior3/5

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

No annotations provided; description indicates read-only behavior ('list') but does not disclose any potential side effects, rate limits, or performance implications.

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?

Extremely concise (two words) and front-loaded. Every word is necessary.

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

Completeness5/5

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

For a simple listing tool with no parameters and no output schema, the description adequately conveys its purpose.

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

Parameters4/5

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

Input schema has 0 parameters with 100% coverage, so description does not need to add extra meaning. Baseline 4 applies.

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 uses a specific verb 'list' and resource 'collections', and clarifies scope as 'all'. It implicitly distinguishes from sibling 'get_collection' which retrieves a single collection.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like 'get_collection'. No context on prerequisites or conditions.

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