Skip to main content
Glama
0103juan

legacy-db-mcp

by 0103juan

run_query

Query the legacy ERP with a single read-only SELECT, returning up to 200 rows while blocking writes and masking sensitive columns.

Instructions

Run one read-only SELECT against the legacy ERP and return up to 200 rows.

Only a single SELECT (CTEs allowed) is accepted; writes, DDL, PRAGMA and ATTACH are rejected
by the database engine. Restricted columns read as NULL. Aggregate in SQL rather than
fetching raw rows -- results past the row limit are dropped and `truncated` is set.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so well: it discloses read-only enforcement, the rejected statement classes, that restricted columns silently read as NULL, the 200-row cap, and that a `truncated` flag signals dropped results. These are exactly the behavioral traits an agent needs to write correct SQL and interpret output.

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?

Front-loaded with the core operation and limit, followed by constraints and the aggregation hint. Every sentence conveys a distinct, actionable fact with no filler.

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 single-parameter query tool with no output schema and no annotations, the description is nearly complete: it explains accepted input, rejection rules, row limits, and truncation signaling. Minor gaps remain around result shape (column naming) and error surfacing, but nothing critical to correct invocation is missing.

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

Parameters4/5

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

Schema coverage is 0% and the single `sql` parameter has no schema description, so the description must compensate. It does: single statement, CTEs allowed, no writes/DDL/PRAGMA/ATTACH, and the NULL-masking of restricted columns. It stops short of syntax examples or dialect specifics, but covers the essential semantics.

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 (Run), resource (SELECT against the legacy ERP), and scope (read-only, up to 200 rows) in the first sentence. It is clearly distinguishable from the metadata siblings list_tables and describe_table, which do not execute queries.

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 clear operational constraints: only a single SELECT (CTEs allowed) is accepted, and writes/DDL/PRAGMA/ATTACH are rejected. It also advises aggregating in SQL rather than fetching raw rows. It does not explicitly route the agent between this tool and its siblings, but the context is otherwise unambiguous.

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

Deploy Server

Other Tools