Skip to main content
Glama
lokih1028
by lokih1028

run_sql

Executes read-only DuckDB SELECT queries against a Hacker News stories table, enabling custom analysis of scores, comments, domains, and dates.

Instructions

Run one read-only DuckDB SELECT over the stories table for custom analysis.

Columns: id UINTEGER, author VARCHAR, time TIMESTAMP (UTC), title VARCHAR,
url VARCHAR, domain VARCHAR (no 'www.'), score INTEGER, comments INTEGER
(total descendants), text VARCHAR (HTML body of Ask/Show HN posts, else NULL).
Comments themselves are not in the index; use get_thread for those.

Input Schema

NameRequiredDescriptionDefault
sqlYes
limitNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/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 disclose the important traits: read-only, exactly one SELECT, and only the `stories` table is queryable. It does not cover what happens on a rejected non-SELECT, query timeouts, or whether the result set is capped beyond the limit parameter.

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?

Two sentences: the capability and constraint are front-loaded, then a dense but fully earned column reference, then a one-line routing note. No filler and the most decision-relevant facts come first.

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?

An output schema exists, so return values need not be explained, and the schema of the queryable table is fully described. The remaining gap is the unexplained `limit` parameter and the absence of any note on error behavior for malformed SQL.

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 coverage is 0%, so the description must compensate. It does valuable work by enumerating every column with type and semantics (UTC time, domain without 'www.', comments = descendants, text only for Ask/Show HN), which is exactly what the `sql` parameter requires. However, the `limit` parameter (default 200) is never mentioned in the description, leaving its effect undocumented anywhere.

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 ('Run one read-only DuckDB SELECT over the `stories` table') plus the intent ('for custom analysis'), which immediately distinguishes it from the curated siblings like search_stories and domain_report. It also names the boundary (comments require get_thread).

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?

Explicitly routes the agent to get_thread when comment data is needed and frames this tool as the escape hatch for 'custom analysis'. It does not say when to prefer the simpler siblings (search_stories, domain_report) over raw SQL, which is the one obvious routing decision left unstated.

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