Skip to main content
Glama

query_db

Execute read-only SQL queries to retrieve patient data from the OncoFiles medical document management system for monitoring, debugging, and analysis purposes.

Instructions

Run a read-only SQL query against the production database.

Use this for monitoring, debugging, and ad-hoc analysis. Only SELECT/WITH queries are allowed — mutations are blocked.

Args: sql: SQL query (SELECT only). Tables: documents, activity_log, conversations, treatment_events, research_entries, lab_values, document_pages, agent_state, patient_context, schema_migrations. limit: Max rows to return (default 50, max 200).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: it specifies the tool is 'read-only,' blocks mutations, lists available tables, and includes rate-limiting details (default 50, max 200 rows). However, it does not mention authentication needs, error handling, or performance implications, leaving some gaps in behavioral context.

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?

The description is appropriately sized and front-loaded, with the core purpose stated first, followed by usage guidelines and detailed parameter explanations. Every sentence adds value, such as clarifying allowed query types and table availability, with no redundant or wasted information.

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?

Given the tool's complexity (read-only SQL queries), lack of annotations, and presence of an output schema (which handles return values), the description is complete enough. It covers purpose, usage, behavioral constraints, and parameter details, providing all necessary context for an AI agent to select and invoke the tool correctly without redundancy.

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?

The description adds significant meaning beyond the input schema, which has 0% schema description coverage. It explains the 'sql' parameter as 'SQL query (SELECT only)' and lists the available tables, and specifies the 'limit' parameter's default and maximum values. This fully compensates for the lack of schema descriptions, providing clear semantics for both parameters.

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's purpose with a specific verb ('Run') and resource ('SQL query against the production database'), and distinguishes it from siblings by emphasizing read-only operations. It explicitly mentions 'Only SELECT/WITH queries are allowed — mutations are blocked,' which differentiates it from tools like add_activity_log or delete_document that perform mutations.

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?

The description provides explicit usage guidance by stating 'Use this for monitoring, debugging, and ad-hoc analysis' and 'Only SELECT/WITH queries are allowed — mutations are blocked.' This clearly indicates when to use this tool (for read-only queries) versus when not to (for mutations), with alternatives implied in sibling tools like add_activity_log or update_treatment_event for write operations.

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/peter-fusek/oncofiles'

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