Skip to main content
Glama

host.state.query

Read rows from a declared table, optionally filtered (where: "field op value", ops = != < <= > >=, clauses joined by ' and '), ordered (order_by: "field" or "field desc") and capped (limit).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax rows to return; optional.
tableYesName of the declared table to read from.
whereNoOptional filter, e.g. "age > 21"; ops are != < <= > >=, clauses joined by ' and '.
end_userNo"self" for the caller's own verified end-user identity, an explicit subject (only when this call carries no end-user identity of its own), or omit/null for the tenant-wide value.
order_byNoOptional "field" or "field desc" to sort by.
tenant_keyNoThe key `signup` returned. Required only when this connection carries no Authorization: Bearer header -- when both are present, the header wins.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / end_user
      Added value: +{
      +  "description": "\"self\" for the caller's own verified end-user identity, an explicit subject (only when this call carries no end-user identity of its own), or omit/null for the tenant-wide value.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / limit / description
      Added value: +"Max rows to return; optional."
    • addedInput schema / properties / order_by / description
      Added value: +"Optional \"field\" or \"field desc\" to sort by."
    • addedInput schema / properties / table / description
      Added value: +"Name of the declared table to read from."
    • addedInput schema / properties / where / description
      Added value: +"Optional filter, e.g. \"age > 21\"; ops are != < <= > >=, clauses joined by ' and '."
  3. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations are none provided, so the description carries the full burden. It discloses the operation type (read, not mutation) implicitly through the verb 'Read' and the optional parameters. It discloses the filtering syntax and supported operators, sorting syntax, and limit. However, it does not disclose details about what happens if the table doesn't exist, error behavior, permission requirements, or whether it returns raw rows or some structure. The description adds context about syntax (ops = != < <= > >=, clauses joined by ' and ') which goes beyond schema to specify exact filtering syntax.

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, well-structured sentence that introduces the purpose and then details optional clauses in parenthesis. It is front-loaded with action and resource, then details the parameters in a compact way. No wasted words; every part adds value.

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

Completeness4/5

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

For a read query tool with no output schema, the description explains the main parameters and syntax. It doesn't mention return format (e.g., array of rows) or error cases, but given the tool's complexity is low to moderate, and schema covers all parameters, it is fairly complete. It could be improved by noting that it returns rows or that the table must exist, but the essentials are covered. It handles the syntax for where and order_by, which are the trickiest parts.

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 each parameter (table, where, order_by, limit, end_user, tenant_key). The description adds minimal additional semantic value: it clarifies that where clauses support specific operators and joining, and that order_by uses 'field' or 'field desc', and that limit caps rows. However, it doesn't add about end_user or tenant_key beyond what's in schema. Baseline 3 is appropriate because the schema already explains each parameter well, and the description adds some syntax details.

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 states a specific verb ('Read'), a clear resource (rows of a declared table), and outlines optional operations (filtering with where, ordering, capping). It distinguishes from siblings like host.state.get (single row), host.state.list (likely listing resources), host.state.delete_rows (deletion), host.table.query (querying tables from a different namespace), and host.state.insert by focusing on reading rows with filters/order/limit.

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?

The description clearly describes the functionality and conditions for using it (reads rows from a declared table, supports optional filtering, ordering, and limitation). It implies usage: when you need to fetch multiple rows based on criteria. It doesn't explicitly mention when NOT to use it or point to alternatives like host.state.get for single keys, but given the sibling set, the description is clear enough to select this tool for read operations. A sibling distinction is partially present through the description of capabilities.

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