Skip to main content
Glama
timsuv

sql-explorer-mcp

by timsuv

Join tables

join_tables

Join multiple tables or views using explicit, schema-validated conditions. Query up to 200 rows with up to 6 joins, without raw SQL.

Instructions

Select across multiple tables/views with explicit join conditions. Every table and column is validated against the real schema (same as browse_table/query_table) — no raw SQL fragments are accepted. Max 200 rows, up to 6 joins.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseYesThe first table in the FROM clause
joinsYesJoins, applied in order — each may only reference aliases already introduced
limitNoRow limit (default 50, max 200)
whereNoOptional single WHERE condition
columnsNoColumns to select, as {alias, column} pairs. Defaults to all columns from all joined tables, each output as alias_column.
Behavior4/5

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

With no annotations, the description carries full behavioral disclosure. It states validation of every table/column against the real schema, rejection of raw SQL fragments, and hard limits (max 200 rows, up to 6 joins). These are meaningful behavioral constraints beyond what the schema shows, though it does not describe output format or error cases.

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 efficient sentences: the first states the core purpose, the second adds key constraints. No filler, front-loaded, and every sentence earns its place.

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 tool with 5 parameters, nested objects, and no output schema, the description covers the essential high-level behavior and limitations. The schema provides detailed parameter semantics, and the description fills in the validation and limit context. It lacks explicit note about join ordering or column defaults, but those are captured in the schema descriptions, so the overall completeness is strong.

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 baseline is 3. The description mostly reiterates schema facts (max rows, join limit) and adds the validation/no-raw-SQL context, but does not add deeper meaning to parameters beyond what the schema already provides.

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 clearly states the tool selects across multiple tables/views with explicit join conditions. It uses a specific verb (select) and resource (multiple tables/views), and distinguishes itself from single-table tools like browse_table/query_table by highlighting joins.

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 gives strong context: it validates against the real schema (same as browse_table/query_table) and explicitly forbids raw SQL fragments, implying this is for structured multi-table queries rather than raw SQL (run_query). It does not explicitly name alternatives or state 'use this when...', but the context and sibling names make the intended use clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/timsuv/sql-explorer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server