Skip to main content
Glama

query_table

Read-only

Queries records from a Caspio table. The backend supports Microsoft SQL Server WHERE syntax (LIKE, AND, OR, NOT, IN, BETWEEN, comparison operators, etc.). Returns a JSON object with a 'records' array of flat key-value objects where keys are field names, and optional 'pagination' metadata when getPaginationInfo is true. Maximum 1000 records per request (default 100). For larger result sets, use pageNumber and pageSize to paginate. IMPORTANT: field names are case-insensitive and must come from discover_tables' field list -- never guess a field name from its label or from naming conventions. Call discover_tables first for any table not already discovered earlier in this conversation to get its tableId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of records returned (skipped when pageNumber or pageSize is not empty, max = 1000, default = 100)
whereNoWHERE clause. Examples: 'YesNoBoolField=1'; 'NumField=123 AND (StrField=N'Abc' OR DateField<='2001-01-31 23:59:59')'; 'Name = N'O''Brien'' (N prefix denotes Unicode, use '' to escape single quotes)'
selectYesSELECT field list (required). Use '*' to return all fields (safe default). Examples: '*'; 'PK_ID'; 'Field1, Field2'; 'COUNT(*) as Total'
groupByNoGROUP BY clause. Use when grouping results by specific fields with aggregate functions. Examples: 'PK_ID', 'Field1, Field2'
orderByNoORDER BY clause. Examples: 'PK_ID', 'Field1 ASC, Field2 DESC'
tableIdYesTable Id (obtained from discover_tables, e.g. 'd99357') -- the table's name has no meaning for API calls; only the Id can be used here.
pageSizeNoNumber of records per page (possible values from 5 to 1000, default = 25)
pageNumberNoPage number (default = 1)
getPaginationInfoNoReturn pagination info (total_count, page_size, page_number) in a 'pagination' object. Default is false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint/destructiveHint annotations, the description discloses the JSON output shape, pagination metadata, the 1000-record cap, the default of 100, case-insensitive field lookups, and the requirement to source field names from discover_tables. This is substantial behavioral 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 dense but each sentence carries load: operation, SQL dialect, return shape, limits, pagination strategy, and a highlighted prerequisite. The most important fact (what it does) is front-loaded.

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?

With no output schema, the description sufficiently documents the return structure and pagination metadata. It also covers the necessary prerequisite (discover_tables), query syntax, and boundary conditions, so an agent has what it needs to invoke the tool correctly.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds crucial semantics: pagination defaults and cap, getPaginationInfo's effect, tableId provenance, and especially the rule that field names must come from discover_tables rather than labels. These are not inferable from property descriptions alone.

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 opens with a specific action and resource: 'Queries records from a Caspio table,' and clarifies the return shape. It does not explicitly contrast with sibling query_view or other record tools, though the table-vs-view resource distinction is implicit in the wording.

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?

It gives clear operational guidance: call discover_tables first to get a tableId, never guess field names, and paginate with pageNumber/pageSize for result sets over 1000. It does not state when to prefer query_view or other siblings, so it stops short of explicit when-not/alternative routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources