Skip to main content
Glama
andrewlwn77
by andrewlwn77

search_records

Search for database records using a query string to find specific information within NocoDB tables. Apply filters, sorting, and pagination to refine results.

Instructions

Search for records containing a query string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_idYesThe ID of the base/project
table_nameYesThe name of the table
queryYesSearch query string
whereNoAdditional filter condition
sortNoSort fields
limitNoNumber of records to return
offsetNoNumber of records to skip

Implementation Reference

  • MCP tool handler for 'search_records' that invokes NocoDBClient.searchRecords with provided arguments and formats the response.
      handler: async (
        client: NocoDBClient,
        args: {
          base_id: string;
          table_name: string;
          query: string;
          where?: string;
          sort?: string;
          limit?: number;
          offset?: number;
        },
      ) => {
        const result = await client.searchRecords(
          args.base_id,
          args.table_name,
          args.query,
          {
            where: args.where,
            sort: args.sort,
            limit: args.limit,
            offset: args.offset,
          },
        );
        return {
          records: result.list,
          pageInfo: result.pageInfo,
          count: result.list.length,
          query: args.query,
        };
      },
    },
  • Input schema defining parameters for the 'search_records' tool.
    inputSchema: {
      type: "object",
      properties: {
        base_id: {
          type: "string",
          description: "The ID of the base/project",
        },
        table_name: {
          type: "string",
          description: "The name of the table",
        },
        query: {
          type: "string",
          description: "Search query string",
        },
        where: {
          type: "string",
          description: "Additional filter condition",
        },
        sort: {
          type: "string",
          description: "Sort fields",
        },
        limit: {
          type: "number",
          description: "Number of records to return",
        },
        offset: {
          type: "number",
          description: "Number of records to skip",
        },
      },
      required: ["base_id", "table_name", "query"],
    },
  • src/index.ts:55-62 (registration)
    Includes recordTools (containing 'search_records') in the allTools array registered with MCP server handlers for list and call requests.
    const allTools = [
      ...databaseTools,
      ...tableTools,
      ...recordTools,
      ...viewTools,
      ...queryTools,
      ...attachmentTools,
    ];
  • NocoDBClient.searchRecords method implementing client-side fuzzy search by fetching records and filtering those containing the query string.
    async searchRecords(
      baseId: string,
      tableName: string,
      query: string,
      options?: QueryOptions,
    ): Promise<{ list: NocoDBRecord[]; pageInfo: any }> {
      // For now, use regular list with client-side filtering
      // since NocoDB search syntax is complex
      const records = await this.listRecords(baseId, tableName, options);
      const filtered = records.list.filter((record) => {
        return Object.values(record).some((value) =>
          String(value).toLowerCase().includes(query.toLowerCase()),
        );
      });
      return { list: filtered, pageInfo: records.pageInfo };
    }
Behavior2/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 mentions searching 'containing a query string', which hints at text matching, but lacks details on permissions, rate limits, pagination (despite limit/offset params), error handling, or return format. For a search tool with 7 parameters and no annotations, this is insufficient.

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 single sentence with zero wasted words. It's front-loaded with the core purpose ('search for records'), making it easy to parse quickly.

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?

For a search tool with 7 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain the return structure, error conditions, or behavioral nuances like how 'query' interacts with 'where'. The schema covers parameter basics, but the description fails to provide necessary context for effective use.

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 parameters are well-documented in the schema. The description adds minimal value by implying 'query' is for text search, but doesn't clarify interactions between 'query' and 'where', or how sorting/limiting works. Baseline 3 is appropriate as the schema handles most semantics.

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

Purpose4/5

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

The description clearly states the action ('search for records') and target resource ('records'), specifying the search is based on a 'query string'. It distinguishes from siblings like 'list_records' (which likely lists without search) and 'query' (which may have different semantics), but doesn't explicitly differentiate them.

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 'list_records', 'query', or 'get_record'. The description implies searching within content, but doesn't specify prerequisites, constraints, or comparative use cases with sibling tools.

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/andrewlwn77/nocodb-mcp'

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