Skip to main content
Glama
renanlido

Custom MCP Database Server

by renanlido

db_execute_query

Destructive

Execute SQL queries with bind parameters or MongoDB JSON filters against configured databases (PostgreSQL, MySQL, Oracle, MongoDB) with automated result limiting, without exposing credentials.

Instructions

Run a query against a configured database.

SQL (postgres/mysql/oracle): pass the SQL string in query and optional bind values in params (use the driver's placeholder style; Oracle uses :name). Add your own LIMIT/WHERE to keep results small.

MongoDB: pass a JSON filter object in query and the collection name. 24-char hex strings are coerced to ObjectId; empty filters are rejected; results are capped at limit documents (default 10).

Returns: {"data": [...], "row_count": int} (plus "error" on a rejected empty Mongo filter)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
paramsNo
collectionNo
oracle_schemaNo
database_aliasYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Beyond annotations (destructiveHint=true), it discloses behavior like empty Mongo filter rejection, result capping, and Oracle placeholder style, but lacks details on auth or rate limits.

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?

Well-structured with clear front-loaded purpose and bullet-style details for different DB types; no redundant sentences.

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

Completeness5/5

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

Covers 6 parameters, required/optional, return format, and error cases; output schema exists but description still adds value with row_count and error details.

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

Parameters5/5

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

With 0% schema description coverage, the description fully explains parameters: query type per DB, params, collection, limit, oracle_schema, and database_alias.

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 it runs queries against configured databases, distinguishes between SQL and MongoDB usage, and aligns with sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance for SQL (add LIMIT/WHERE, use driver placeholder style) and MongoDB (JSON filter, collection name, empty filter rejection, result cap), helping agents formulate correct queries.

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/renanlido/custom-mcp-database'

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