Skip to main content
Glama

run_sql

Executes a read-only SELECT query against the Garmin SQLite database for questions other tools cannot answer; use the v_day, v_week, or v_trends views.

Instructions

Run one read-only SELECT against the database for questions the other tools cannot answer. Prefer the views v_day (one row per day), v_week and v_trends. Raw API payloads are not accessible.

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": {
      "query": "<query>"
    },
    "name": "run_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYes
max_rowsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden, and it does disclose several real constraints: read-only, exactly one SELECT, and no access to raw API payloads, plus the preferred views to query. It says nothing about timeouts, row-scan limits, permission scope, or what happens when a query is rejected or too expensive. Those are material gaps for a free-form SQL execution tool, though the output schema relieves it of describing return values.

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?

Three short sentences with zero filler, and the primary constraint (read-only single SELECT) plus the fallback role are front-loaded before the query-writing hints. Every clause carries information the agent would otherwise have to guess.

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

Completeness3/5

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

An output schema exists, so return shape need not be explained, and the description covers the essential safety posture and the recommended views. However, for a tool whose whole risk surface is arbitrary SQL against an undocumented schema, leaving max_rows unexplained and giving no failure or cost behavior leaves the definition only minimally sufficient.

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

Parameters2/5

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

Schema description coverage is 0% across two parameters, so the description must compensate and largely does not: it never mentions max_rows, its default of 200, or whether it caps returned rows. The word "SELECT" implicitly characterizes the query parameter as SQL text, but no dialect, table list, or column semantics are given beyond the three view names.

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?

"Run one read-only SELECT against the database" names a specific verb, resource, and execution constraint (single statement, read-only), and the clause "for questions the other tools cannot answer" positions it as a fallback distinct from the concrete siblings like get_day, get_range_summary, and compare_periods. An agent can tell what this does and when it is the odd one out without inspecting 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?

It gives an explicit selection rule: use this only when the other tools cannot answer, which is a genuine when-to-use gate against the nine specialized siblings. It also steers query construction toward v_day, v_week, and v_trends and rules out raw API payloads. It stops short of naming which specific sibling covers which question, but that is a reasonable division of labor.

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