Skip to main content
Glama

query_table

Retrieve rows from a MySQL table using structured equality filters, selected columns, ordering, and row limits—no SQL strings required.

Instructions

Query rows from a table with structured parameters — no SQL strings are accepted. WHERE conditions are equality-only key/value pairs ({ status: "active" }); use columns to narrow the output; limit defaults to 20 and is hard-capped at 200 rows. Workflow: describe_table first to learn column names, then query with a small limit and narrow columns, expanding only when needed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "table": "<table>"
    },
    "name": "query_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax rows to return. Default 20, hard cap 200.
tableYesTable name (from list_tables)
whereNoEquality filters as { column: value } pairs, combined with AND. e.g. { "status": "active", "user_id": 42 }. No operators or SQL fragments — values are parameterized and never interpolated.
offsetNoRows to skip. Default 0. Prefer WHERE filters over offset for large tables.
columnsNoColumns to return, e.g. ["id", "name"]. Default: all columns ("*"). Max 50.
order_byNoOrdering as "column" or "column DESC", e.g. "id DESC". Default: no ordering.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does real work: it discloses that SQL strings are rejected, that filters are equality-only combined with AND, that limit defaults to 20 and is hard-capped at 200. It omits permission requirements and error behavior (e.g., unknown column or table), which matters given a check_permissions sibling exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the key constraint (no SQL) and then the filter semantics and workflow; every sentence carries information. Minor redundancy with the schema on the limit default/cap and WHERE equality rule keeps it from a 5.

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 six-parameter, nested-object tool with no annotations and no output schema, the description covers query mechanics, constraints, and call ordering well. It leaves the return shape and permission/error behavior unstated, which is a modest gap rather than a blocking one.

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 limit, where, columns, offset, and order_by with examples. The description restates the limit cap and the equality-only WHERE semantics rather than adding new meaning, so the baseline of 3 applies.

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?

States a specific verb and resource ("Query rows from a table") and immediately delimits scope with "no SQL strings are accepted" and equality-only WHERE pairs. The workflow sentence naming describe_table makes it distinguishable from list_tables/describe_table siblings without opening any schema.

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?

Gives an explicit prescriptive workflow: describe_table first to learn columns, then query with a small limit and narrow columns, expanding only when needed. It does not state exclusions (e.g., when to prefer list_tables, or that check_permissions may gate access), so it stops short of full when/when-not coverage.

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