Skip to main content
Glama
nongtiensonpro

Document RAG MCP

query_tables

Execute SQL queries on document-extracted tables stored in DuckDB. Use COUNT, GROUP BY, JOIN, and WHERE to analyze structured data without manual extraction.

Instructions

Execute a SQL query on extracted tables stored in DuckDB.

Use list_tables() first to discover available table names and column schemas. Supports COUNT, GROUP BY, JOIN, WHERE, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations, the description carries the transparency burden. It communicates that this is a read-style SQL query via supported operations like COUNT, GROUP BY, JOIN, and WHERE, which implies no data mutation. However, it does not explicitly state read-only behavior, result limits, or error/edge-case behavior, leaving some ambiguity for arbitrary SQL.

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, each earning its place: the core action, the prerequisite discovery step, and the supported SQL feature set. The most important usage instruction is front-loaded after the one-line purpose, with no filler or repetition.

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?

Given the tool has only one parameter and an output schema exists, the description covers the essential call context: what the SQL targets, how to find valid table names and schemas, and which operations are supported. It misses minor items like explicit read-only confirmation, but for a simple query tool with low parameter complexity it is adequately complete.

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?

The schema provides only the parameter name 'sql' with no description, so the description must compensate. It does so by clarifying that the parameter is a SQL query against DuckDB, listing supported clauses, and linking to list_tables for schema discovery. This is sufficient for the single parameter, though a small syntax example would make it even stronger.

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 states a specific verb and resource: 'Execute a SQL query on extracted tables stored in DuckDB.' It goes beyond a bare name by specifying the database engine and the supported SQL operations, making it clearly distinct from sibling tools like list_tables or aggregate.

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 explicitly instructs the agent to 'Use list_tables() first to discover available table names and column schemas,' which gives clear before-use context. It does not explicitly mention when not to use this tool or name an alternative for non-query needs, so it stops short of a full 5.

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/nongtiensonpro/document-rag-mcp'

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