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
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |