Skip to main content
Glama

search_records

Locate records containing specified text within a resource URI. Define search terms, specific fields, and limit results for targeted record retrieval.

Instructions

Search for records containing specific text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsNoSpecific fields to search in. If not provided, searches all text fields.
maxRecordsNoMaximum number of records to return. Defaults to 100.
resourceUriYesURI of the resource
searchTermYesText to search for in records

Implementation Reference

  • Handler logic for the 'search_records' tool. Validates input arguments using SearchRecordsArgsSchema and delegates the search query to the dataService.queryResource method with searchTerm, fields, and maxRecords parameters.
    case 'search_records': {
      return await safeExecute(toolName, async () => {
        const args = validateInput(SearchRecordsArgsSchema, request.params.arguments);
        const records = await this.dataService.queryResource(
          args.resourceUri,
          {
            searchTerm: args.searchTerm,
            fields: args.fields,
            maxRecords: args.maxRecords,
          }
        );
        return records;
      });
    }
  • Zod schema defining the input arguments for the search_records tool: resourceUri (required), searchTerm (required), fields (optional array), maxRecords (optional number).
    export const SearchRecordsArgsSchema = z.object({
      resourceUri: z.string().describe('URI of the resource'),
      searchTerm: z.string().describe('Text to search for in records'),
      fields: z.array(z.string()).optional().describe('Specific fields to search in. If not provided, searches all text fields.'),
      maxRecords: z.number().optional().describe('Maximum number of records to return. Defaults to 100.'),
    });
  • Tool registration entry in the handleListTools method, specifying the name, description, and input schema for 'search_records'.
      name: 'search_records',
      description: 'Search for records containing specific text',
      inputSchema: getInputSchema(SearchRecordsArgsSchema),
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits like whether this is a read-only operation (implied but not explicit), performance characteristics, pagination behavior, error conditions, or authentication requirements. The description is minimal and lacks operational context.

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, efficient sentence with zero wasted words. It's appropriately sized for a simple search tool and front-loads the core purpose without unnecessary elaboration.

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?

Given no annotations and no output schema, the description is incomplete for a search tool with 4 parameters. It doesn't explain what 'records' are, the search scope, result format, or limitations. For a tool that likely returns complex data, more context is needed to guide 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 the schema already fully documents all 4 parameters. The description adds no additional meaning beyond what's in the schema—it doesn't explain parameter interactions, default behaviors beyond schema defaults, or search semantics. Baseline 3 is appropriate when schema does all the work.

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

Purpose3/5

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

The description 'Search for records containing specific text' clearly states the verb ('search') and resource ('records'), but it's vague about scope and doesn't distinguish from sibling tools like 'list_records' or 'get_record'. It doesn't specify what type of records or system is involved.

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 is provided on when to use this tool versus alternatives like 'list_records' or 'get_record'. The description implies text-based searching but doesn't clarify if this is for full-text search versus metadata filtering or when to prefer one sibling tool over another.

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

Related 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/kbhuw/MCP_TEMPLATE'

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