Skip to main content
Glama

list_records

Retrieve and filter records from a specified resource URI, set a maximum number of results, and sort data using customizable criteria for structured querying.

Instructions

List records from a resource

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoFilter criteria
maxRecordsNoMaximum number of records to return. Defaults to 100.
resourceUriYesURI of the resource to query
sortNoSpecifies how to sort the records

Implementation Reference

  • Handler implementation for the 'list_records' tool. Validates input arguments using ListRecordsArgsSchema and queries the data service for records with optional filtering and sorting.
    case 'list_records': {
      return await safeExecute(toolName, async () => {
        const args = validateInput(ListRecordsArgsSchema, request.params.arguments);
        const records = await this.dataService.queryResource(
          args.resourceUri,
          {
            maxRecords: args.maxRecords,
            filter: args.filter,
            sort: args.sort,
          }
        );
        return records;
      });
    }
  • Registration of the 'list_records' tool in the handleListTools method, specifying name, description, and input schema.
    {
      name: 'list_records',
      description: 'List records from a resource',
      inputSchema: getInputSchema(ListRecordsArgsSchema),
    },
  • Zod schema defining the input arguments for the 'list_records' tool, including resource URI, optional max records, filter, and sort options.
    export const ListRecordsArgsSchema = z.object({
      resourceUri: z.string().describe('URI of the resource to query'),
      maxRecords: z.number().optional().describe('Maximum number of records to return. Defaults to 100.'),
      filter: z.record(z.unknown()).optional().describe('Filter criteria'),
      sort: z.array(z.object({
        field: z.string().describe('Field name to sort by'),
        direction: z.enum(['asc', 'desc']).optional().describe('Sort direction. Defaults to asc (ascending)'),
      })).optional().describe('Specifies how to sort the records'),
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'List records' implies a read operation, but the description doesn't mention pagination behavior (though maxRecords parameter hints at it), authentication requirements, rate limits, error conditions, or what format the records are returned in. It provides minimal behavioral context beyond the basic operation.

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 extremely concise at just 5 words with no wasted language. It's front-loaded with the core purpose. While it may be too brief for completeness, as a standalone statement it's efficiently structured.

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 tool with 4 parameters, no annotations, no output schema, and multiple sibling alternatives, the description is inadequate. It doesn't explain the relationship between this listing operation and other record operations, doesn't describe return format, and provides minimal context for when this specific listing approach is appropriate.

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 documents all parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain how 'resourceUri' relates to the listing, what filtering capabilities exist, or sorting behavior. Baseline 3 is appropriate when schema does the heavy lifting.

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 'List records from a resource' clearly states the action (list) and target (records from a resource), but it's vague about scope and doesn't distinguish from sibling tools like 'search_records' or 'get_record'. It provides basic purpose but lacks specificity about what kind of listing operation this performs.

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 about when to use this tool versus alternatives like 'search_records' or 'get_record'. The description gives no indication of prerequisites, appropriate contexts, or exclusions. Users must infer usage from the tool name alone.

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