codeDB Lens
OfficialConnects read-only to PostgreSQL instances (15–18, plus managed offerings) to run an evidence-based health-check rule catalog, producing an A–F graded report with findings, coverage and next actions. Also lists and describes tables and answers questions with a single read-only SELECT at a time, within row and time limits.
v0.8:
check(with an executive summary and--redactfor sharing),compare, andrecord+reportto watch an instance for up to 24 hours (how). 26 rules plus 8 for recordings. FAQ and more on the website.
codeDB Lens connects to your instance with a read-only login, runs a catalog of evidence-based rules and writes a self-contained HTML + JSON report with an A–F grade and a coverage seal (the share of rules that could actually run). Nothing about your database leaves your machine.
Install
Where | How |
Windows | |
Windows (Scoop) |
|
Linux |
|
Docker |
|
The Windows binaries are open source but not code-signed yet, so SmartScreen may show a warning. Why, and how to verify the download.
Related MCP server: mcp-database
Why another tool?
Evidence, not opinions. Every finding shows the collected values, the query that produced them and when.
Honest confidence. Each finding is Confirmed, Hint or No data. A rule that lacks permission never shows up as a false "OK"; it lowers the coverage instead.
Read-only, always. No DDL, no DML, no agent, no installation on the server.
Rules are data. Each rule is a YAML file plus a SQL query. Contributions don't touch the engine.
English and Portuguese (Brazil), in the app, the CLI and the report.
What it checks
SQL Server | PostgreSQL |
Missing or old backups | Version out of support |
No recent clean DBCC CHECKDB | pg_stat_statements not available |
Failing SQL Agent jobs | A single query dominating execution time |
Disk or transaction log running out of space | Long and idle-in-transaction sessions |
Dominant waits, translated | Sessions blocked by locks |
Sessions blocked right now | Transaction ID wraparound risk |
A single query dominating CPU | Dead rows and autovacuum falling behind |
Instance settings left at defaults | Replication slots retaining WAL, replica lag |
TempDB file layout | Connections near the limit, no pooler |
Version out of support | Unused, duplicate and invalid indexes |
High-impact missing indexes | Estimated table bloat |
Unused and duplicate indexes | Largest tables |
Each rule has a documentation page with what it checks, why it matters, what to do and its limits.
Quick start
On Windows, open codeDB Lens from the Start menu. Pick the engine, enter the server and run the diagnosis. Connection profiles are saved; passwords go to the Windows Credential Manager.
Command line (Windows and Linux):
codedb-lens check --engine mssql --server prod01 --auth windows
codedb-lens check --engine pg --dsn-env PG_DSNPasswords are never accepted as command-line arguments. Use integrated auth, an environment variable or a saved profile.
Use with AI (MCP)
Ask Claude, GitHub Copilot or Cursor about your database. codedb-lens mcp is a read-only MCP server that your AI
client starts on your computer, with your saved profiles:
Diagnosis: with the Lens's minimal login, the AI runs the health check, reads recordings and explains what to fix, without reading business data.
Data: with a login that reads the tables you choose, the AI lists and describes them and answers questions with one
SELECTat a time, within row and time limits.
codedb-lens mcp install --client claude-desktop --profile prod # or vscode, cursor, claude-codeThe app's AI (MCP) screen has the commands ready to copy. Guide: lens.codedb.com.br/mcp.
Minimum permissions
-- SQL Server
CREATE LOGIN codedb_lens WITH PASSWORD = '<strong password>';
GRANT VIEW SERVER STATE TO codedb_lens;
GRANT VIEW ANY DEFINITION TO codedb_lens;
GRANT CONNECT ANY DATABASE TO codedb_lens; -- per-database rules (indexes); no data access
USE msdb;
CREATE USER codedb_lens FOR LOGIN codedb_lens;
ALTER ROLE db_datareader ADD MEMBER codedb_lens;
ALTER ROLE SQLAgentReaderRole ADD MEMBER codedb_lens;-- PostgreSQL (repeat GRANT CONNECT for each database)
CREATE ROLE codedb_lens LOGIN PASSWORD '<strong password>';
GRANT pg_monitor TO codedb_lens;
GRANT CONNECT ON DATABASE app TO codedb_lens;Supported versions
Engine | Supported | Best-effort |
SQL Server | 2017, 2019, 2022, 2025 (Windows and Linux), Azure SQL Managed Instance, Amazon RDS | 2016 and older; Azure SQL Database (6 of 13 rules apply, see permissions) |
PostgreSQL | 15, 16, 17, 18, Amazon RDS, Aurora, Azure Flexible Server | 14 |
Privacy
No telemetry. Lens makes two kinds of network calls: an optional, once-a-day version check against GitHub Releases
that sends no data (--no-update-check or CODEDB_LENS_NO_UPDATE=1 turns it off), and, only when you ask for the free
key, one registration request with the name and e-mail you type (or, when renewing, only the current key). See SECURITY.md.
Need continuous monitoring?
Lens shows a snapshot. codeDB watches your SQL Server and PostgreSQL instances around the clock, with history, baselines and alerts on Teams, Slack and e-mail.
Windows code signing
Windows binaries are built by GitHub Actions from this repository and are not code-signed yet (certificates are paid and this is a free project). Details, how to verify a download and warning-free alternatives: Why Windows shows a warning.
Contributing
New rules are especially welcome. A rule is a YAML file plus a SQL query, so you don't need to touch the Go code: see CONTRIBUTING.md, or just open an issue with a rule idea.
License
Apache 2.0. The codeDB SaaS and its API are separate, closed-source products.
Available Tools
14 toolscheckBRead-only
Run the codeDB Lens health check on a profile (read-only, 10-60 s): A-F grade with its coverage, findings with severity, confidence, evidence preview and next action, and rules without data. Saves the report in the profile's history, like the app does.
| Name | Required | Description | Default |
|---|---|---|---|
| redact | No | mask host, database, object, login and file names and drop query text | |
| profile | Yes | profile name from list_profiles |
Output Schema
| Name | Required | Description |
|---|---|---|
| note | Yes | |
| grade | Yes | |
| score | Yes | |
| passed | Yes | |
| report | Yes | |
| server | Yes | |
| no_data | Yes | |
| coverage | Yes | |
| findings | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description explicitly says the tool is 'read-only' but also says it 'Saves the report in the profile's history.' Persisting a report to history is a write-like side effect, which contradicts the readOnlyHint=true annotation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that efficiently packs runtime, output contents, and persistence behavior. It is dense but not wasteful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that an output schema exists, the description need not explain return values. It covers runtime and the main result categories, though it omits explicit sibling selection guidance and leaves the read-only/history-save tension unresolved.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so both parameters are already documented. The description mentions operating 'on a profile' but adds no syntax, format, or constraint details beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Run the codeDB Lens health check on a profile.' The output summary (A-F grade, findings, rules without data) further distinguishes it from siblings such as query, compare, or list_rules.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It implies use when a profile-level health check is wanted and gives runtime expectations, but it gives no explicit when-not-to-use guidance and does not mention alternatives like compare, describe_table, or explain_rule.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
compareARead-only
Compare two runs of the same instance: new, resolved and persisting findings and the grade change. Default: the two latest runs. Needs the user's free key (codedb-lens register).
| Name | Required | Description | Default |
|---|---|---|---|
| a | No | older run path from history; default: the second latest | |
| b | No | newer run path from history; default: the latest | |
| profile | Yes | profile name from list_profiles |
Output Schema
| Name | Required | Description |
|---|---|---|
| new | Yes | |
| after | Yes | |
| before | Yes | |
| report | Yes | |
| changed | Yes | |
| resolved | Yes | |
| warnings | No | |
| persisting | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true; the description adds genuinely non-structured context — the auth/key requirement and the default pair of runs. It still doesn't clarify what happens if fewer than two runs exist or whether runs must be from the same profile, which are the practical failure modes for a diff tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One sentence front-loads the operation and its output, followed by the default and the auth prerequisite. No filler, no repetition of the name, and every clause carries information the agent needs.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description need not explain return values, and it covers defaults and the key requirement. The only gap is edge-case behavior — what happens with fewer than two runs or mismatched run origins — which keeps it from being fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, with a/b already documented as older/newer run paths and profile pointing at list_profiles. The description's 'two latest defaults' reinforces the a/b ordering but adds no syntax, format, or constraint detail beyond the schema, so baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (compare) and resource (two runs of the same instance), and even names what the result contains: new, resolved and persisting findings plus grade change. That output framing separates it cleanly from siblings like history (which lists runs) and get_finding (which retrieves one).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a concrete default (the two latest runs) and an explicit prerequisite (the user's free key via codedb-lens register), so an agent knows how to call it with minimal input. It does not name alternatives or say when not to use it, e.g. when the user only needs a single run's findings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
describe_tableARead-only
Columns (type, nullable, default), primary key, foreign keys with the referenced table, indexes and estimated rows of one table or view. Use it before writing a query, so column names are right.
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | table or view: schema.name, or name in the default schema | |
| profile | Yes | profile name from list_profiles | |
| database | No | database name from list_databases; default: the profile's |
Output Schema
| Name | Required | Description |
|---|---|---|
| name | Yes | |
| type | Yes | |
| schema | Yes | |
| columns | Yes | |
| indexes | Yes | |
| primary_key | Yes | |
| foreign_keys | Yes | |
| estimated_rows | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so safety is covered; the description additionally signals that row counts are 'estimated' (i.e. catalog statistics, potentially approximate). Beyond that it does not describe freshness of the metadata, cost, or failure behavior for non-existent tables, and much of its return-content detail overlaps the output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no filler. The return inventory is front-loaded and the usage note follows economically, though leading with a noun phrase rather than a verb makes the opening marginally less scannable.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description needn't explain return values, yet it still previews them, and it covers the when-to-use. Combined with 100% parameter coverage and read-only annotations, an agent has essentially everything needed to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%: 'table' documents the schema.name/default-schema form, 'profile' points to list_profiles, and 'database' documents its default. The description adds no parameter meaning beyond this, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
It enumerates the concrete resource of the operation — 'one table or view' — and lists the returned artifacts (columns with type/nullable/default, primary key, foreign keys with referenced table, indexes, estimated rows), which makes the scope unambiguous. It stops short of naming a sibling (e.g. list_tables) to contrast with, so it is clear but not differentiating.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Use it before writing a query, so column names are right' gives a concrete triggering situation rather than vague advice. There are no explicit exclusions or named alternatives, but the preparatory framing is enough to place it relative to query and list_tables.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
explain_ruleARead-only
Explain one rule: what it measures, why it matters, the next action, how to verify the fix, the permission it needs, its SQL and its documentation link.
| Name | Required | Description | Default |
|---|---|---|---|
| rule_id | Yes | rule ID, e.g. MSSQL-BACKUP-001 or PG-AUTOVAC-001 |
Output Schema
| Name | Required | Description |
|---|---|---|
| id | Yes | |
| sql | No | |
| kind | No | |
| title | Yes | |
| caveat | No | |
| engine | Yes | |
| impact | Yes | |
| verify | Yes | |
| doc_url | Yes | |
| category | Yes | |
| severity | Yes | |
| permission | Yes | |
| next_action | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so safety is covered and the description's job is lighter. The description usefully discloses the payload (measured metric, rationale, next action, verification, required permission, SQL, doc link), but says nothing about cost, latency, or failure behavior when the rule_id is unknown/invalid. Note the annotation pair readOnlyHint=true with idempotentHint=false is internally odd, though the description does not contradict it.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One front-loaded sentence with a colon-delimited list of what the explanation returns; every item earns its place and there is no preamble. It is dense but tightly structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description need not describe return values, yet it still previews the explanation's contents, which helps an agent decide whether to call it. Params are fully documented in schema and safety is covered by annotations, leaving only minor gaps like error behavior and a prerequisite pointer.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the single rule_id parameter already carries an example format ('MSSQL-BACKUP-001 or PG-AUTOVAC-001'). The description adds nothing about the parameter, so baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource ('Explain one rule') and enumerates exactly what the explanation covers, so an agent can tell it apart from list_rules or get_finding. It never explicitly names a sibling, so it stops short of a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied: the singular 'one rule' plus a required rule_id suggests a per-rule deep dive after list_rules has produced an ID. There is no explicit when-to-use statement, no stated prerequisite (e.g. obtain the ID from list_rules or get_finding), and no mention of alternatives such as check or get_finding.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_findingARead-only
Full detail of one rule in a saved run: status, impact, next action, how to verify the fix, and all evidence rows. Default run: the latest.
| Name | Required | Description | Default |
|---|---|---|---|
| run | No | run path from history; default: the latest run | |
| profile | Yes | profile name from list_profiles | |
| rule_id | Yes | rule ID from check, e.g. MSSQL-BACKUP-001 |
Output Schema
| Name | Required | Description |
|---|---|---|
| id | Yes | |
| run | Yes | |
| rows | No | |
| title | Yes | |
| caveat | No | |
| impact | Yes | |
| reason | No | |
| run_at | Yes | |
| status | Yes | |
| verify | Yes | |
| columns | No | |
| doc_url | Yes | |
| severity | Yes | |
| truncated | No | |
| confidence | Yes | |
| total_rows | Yes | |
| next_action | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and idempotentHint=false. The description adds useful behavioral context by specifying the returned contents: status, impact, next action, verification guidance, and all evidence rows.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tightly written sentences with no wasted words. The core scope is front-loaded, and the default-run note is placed efficiently at the end.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has an output schema, full parameter documentation, and safety annotations, so the description does not need to explain return formats or permissions. It is nearly complete, though it could better clarify its relationship to explain_rule and list_rules.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so profile, rule_id, and run are already documented in the schema. The description reinforces the default-run behavior but does not add substantial parameter semantics beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific retrieval action and resource: full detail of one rule in a saved run. The scope distinguishes it from list-oriented siblings such as list_rules and from run-level tools like history.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by saying it returns detail for one rule in a saved run and defaults to the latest run. However, it does not explicitly say when to use this instead of explain_rule, check, or list_rules.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
historyARead-only
Saved check runs of a profile, newest first: date, grade, coverage and number of findings. Each run's path can be passed to get_finding or compare.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | how many runs, newest first (default 10, at most 50) | |
| profile | Yes | profile name from list_profiles |
Output Schema
| Name | Required | Description |
|---|---|---|
| runs | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already establish this as a read-only operation, and the description adds helpful context about ordering (newest first), returned fields, and downstream tool compatibility. It does not explain why idempotentHint is false or address pagination beyond what the schema already states.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The definition is two compact sentences with no wasted wording. The core purpose and ordering are front-loaded, followed by a useful downstream routing note.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read-only listing tool with full schema coverage, an output schema, and clear annotations, the description is complete enough to call it correctly. It covers what the tool returns and how results can be used downstream.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so both parameters are well documented in the schema. The description reinforces that results are tied to a profile and ordered newest first, but it adds no additional parameter syntax or constraint details beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the resource: saved check runs of a profile, including the data fields and ordering. It implicitly distinguishes itself from the live-check sibling by saying 'saved' check runs, but it does not explicitly name an alternative tool for selection.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides useful follow-up guidance by noting that each run's path can be passed to get_finding or compare. However, it does not say when to use history instead of check, list_profiles, or other siblings, so usage selection is only implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_databasesARead-only
Databases this profile's login can open: name, state, recovery model or encoding, collation and size in bytes.
| Name | Required | Description | Default |
|---|---|---|---|
| profile | Yes | profile name from list_profiles |
Output Schema
| Name | Required | Description |
|---|---|---|
| note | No | |
| rows | Yes | |
| columns | Yes | |
| truncated | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already establish read-only behavior. The description adds meaningful context by clarifying that results are limited to databases the profile's login can open and by indicating the visible attributes such as state and size, which helps explain the access-scoped result set. It does not cover ordering, pagination, or performance traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single carefully constructed sentence front-loads the resource and scope, then lists the returned fields. There is no wasted text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema and full parameter schema coverage, the description does not need to explain return formatting. It covers the access scope and content of the listing, though it could be more complete by mentioning when to choose this over sibling list tools.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the single profile parameter already documents that it comes from list_profiles. The description adds no further parameter guidance, so the schema does the heavy lifting and the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific list action on databases and adds useful scoping detail: only databases this profile's login can open, plus the fields returned. It does not explicitly contrast with siblings such as list_tables, but the resource is clear enough to distinguish them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use when an agent needs available databases for a profile, especially since the required profile parameter references list_profiles. However, it never states when to prefer this over list_tables or other list tools, nor any exclusions or prerequisites beyond the schema.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_profilesARead-only
List the saved connection profiles you may use: name, engine, host, initial database and language. Never returns passwords or connection strings.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| note | No | |
| profiles | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the read-only profile, but the description adds real value beyond them: it discloses the security guarantee that passwords and connection strings are never returned, and 'you may use' signals that results are permission-filtered to the caller. It does not mention ordering or whether the list is cached, which would have earned a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence with the capability front-loaded and the safety caveat trailing. Every clause earns its place; the enumerated fields are the only mild redundancy given an output schema exists.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Output schema is present and the tool takes no parameters, so the description's job is limited to orienting the agent — which it does, including scope and the data-exclusion guarantee. Nothing needed to call this correctly is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so there is nothing for the description to disambiguate — baseline 4 applies. Note the description instead spends its words on the return shape, which is technically the output schema's job rather than parameter semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('List') and a precisely scoped resource ('saved connection profiles'), then enumerates the returned attributes (name, engine, host, initial database, language). 'Connection profiles' is clearly distinct from sibling resources like list_databases, list_tables, and list_rules, so an agent can route without opening a schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied — an agent reads this to discover which connections are available before querying — but the description never states when to prefer it over list_databases or other siblings, nor any prerequisites or exclusions. Adequate but leaves the selection decision to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_recordingsARead-only
Recordings (activity sampled every 15 s for 1 or 24 h) kept with a profile's reports, newest first. Recordings made elsewhere can still be read with recording_report and their folder.
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | profile name; empty lists the recordings of every profile you may use |
Output Schema
| Name | Required | Description |
|---|---|---|
| recordings | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so the safety profile is known; the description adds real value beyond that with the sampling cadence (every 15 s for 1 or 24 h) and the return ordering (newest first), both of which affect how results should be interpreted. It stops short of disclosing volume or pagination behavior for large profiles.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two compact sentences with the core resource and scope front-loaded and the fallback tool mentioned second. Every clause carries information; there is no filler or restated boilerplate.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description needn't explain return values, and it covers the key behavioral facts an agent needs: read-only access, sampling granularity, ordering, and the alternate route for external recordings. Only pagination or volume expectations are left unaddressed, which is a minor gap for a single optional parameter tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the only parameter's description already explains that an empty value lists recordings of every profile the caller may use. The description reiterates the profile-scoped framing but adds no syntax, format, or edge-case detail beyond the schema, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the resource (recordings kept with a profile's reports) and its scope, including the sampling characteristics and ordering (newest first). It distinguishes itself from recording_report by noting that tool handles recordings made elsewhere, but the listing verb itself is only implied by the tool name rather than stated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly names recording_report as the alternative path for recordings made elsewhere, giving the agent a concrete routing condition. It does not address when not to use this tool broadly (e.g., other listing tools like list_profiles or history), but the key sibling relationship is covered.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_rulesARead-only
List the Lens rule catalog (health checks): ID, engine, category, severity and title. Kind "series" rules judge recordings, the others run in a check.
| Name | Required | Description | Default |
|---|---|---|---|
| engine | No | mssql or pg; empty lists both |
Output Schema
| Name | Required | Description |
|---|---|---|
| rules | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds domain semantics about rule kinds, but says nothing about result size, pagination, or how the catalog is scoped.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, front-loaded with what is listed and what comes back. The rule-kind sentence is compact and meaningful rather than filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema covering return shape, annotations covering safety, and full parameter documentation in the schema, the description supplies enough for an agent to call it correctly. Only the absence of sibling routing keeps it from full marks.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the single engine parameter is already documented as "mssql or pg; empty lists both". The description adds no filtering detail beyond the schema, so baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ("List the Lens rule catalog (health checks)") and enumerates returned fields (ID, engine, category, severity, title). It distinguishes itself from action-oriented siblings like check/explain_rule only implicitly through the noun "catalog"; no sibling is named.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied: this is the enumeration endpoint, and the note that "series" rules judge recordings while others run in a check hints at downstream workflow. It never says when to use this instead of explain_rule or get_finding, and gives no prerequisites or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_tablesARead-only
Tables and views visible to the profile's login in a database: schema, name, type, estimated rows, size and whether the login can read them. Start here, then describe_table, then query.
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | name pattern: plain text matches anywhere in the name, or a LIKE pattern with % | |
| schema | No | only this schema | |
| profile | Yes | profile name from list_profiles | |
| database | No | database name from list_databases; default: the profile's |
Output Schema
| Name | Required | Description |
|---|---|---|
| note | No | |
| rows | Yes | |
| columns | Yes | |
| truncated | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the readOnlyHint=true annotation, the description discloses the important scoping constraint that results are limited to what the profile's login can see, and that readability per table is reported. It omits pagination/row-limit behavior, which is the main remaining unknown for a listing tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two compact sentences, front-loaded with the resource and returned fields, followed by the workflow hint. No filler and nothing repeated from the schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need no prose explanation, and annotations cover safety. Combined with the workflow hint and the login-scoping caveat, an agent has everything needed to call this correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so filter, schema, profile, and database are already fully documented in the schema. The description adds only the concept of login-scoped visibility filtering, not per-parameter semantics; baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Names a specific verb and resource ('list_tables') and then enumerates exactly what each row contains (schema, name, type, estimated rows, size, read permission), which no sibling offers. An agent can distinguish it from describe_table, list_databases, and query without opening a schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The sentence 'Start here, then describe_table, then query' is an explicit workflow that names two alternatives and the order in which to use them. This is the strongest form of routing guidance: it says when to use this tool and what to use next.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
queryARead-only
Run one read-only SELECT (or WITH ... SELECT) on a profile and get columns and rows. Aggregate in SQL (GROUP BY, TOP/LIMIT) instead of fetching raw rows: results stop at the profile's row limit (500 unless the user changed it), cells at 2 KB, and truncated: true means the answer is partial. Writes, EXEC, multiple statements and functions with side effects are refused; quote a column named like an SQL keyword. SQL Server reads uncommitted data, like the health check.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | one SELECT or WITH ... SELECT statement | |
| profile | Yes | profile name from list_profiles | |
| database | No | database name from list_databases; default: the profile's | |
| max_rows | No | row limit; default and ceiling: the profile's | |
| timeout_s | No | seconds; default and ceiling: the profile's |
Output Schema
| Name | Required | Description |
|---|---|---|
| note | No | |
| rows | Yes | |
| columns | Yes | |
| warning | No | |
| truncated | Yes | |
| elapsed_ms | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the readOnlyHint annotation, the description discloses the row limit (500 unless changed), 2 KB cell limit, truncated flag semantics, refusal of multi-statement and side-effecting SQL, keyword-quoting guidance, and uncommitted-read behavior. These are substantial behavioral details an agent needs before calling the tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with the core action, then adds operational guidance and limits in dense but purposeful sentences. Almost every sentence adds a constraint, caveat, or usage rule rather than restating the name.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that annotations mark the tool read-only and an output schema exists, the description covers the critical gaps: SQL restrictions, row/cell truncation, profile row limits, and dirty-read behavior. It is complete enough for an agent to invoke query correctly without needing to inspect sibling tools.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents all five parameters. The description still adds useful meaning by giving the concrete default row limit of 500 unless the user changed it, explaining truncated results, and clarifying that sql must be a single SELECT or WITH ... SELECT.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: run one read-only SELECT (or WITH ... SELECT) on a profile and return columns and rows. This clearly separates it from sibling tools such as list_tables, describe_table, compare, or record_command, which do not execute arbitrary read-only SQL.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives actionable usage guidance: aggregate in SQL with GROUP BY or TOP/LIMIT instead of fetching raw rows, and it explains that writes, EXEC, multiple statements, and side-effecting functions are refused. It does not explicitly route the agent to list_tables/describe_table for schema inspection, so it is clear but not exhaustive.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
record_commandARead-only
The command the user runs in a terminal (or on the server) to record a profile for up to 1 h, or 24 h with the free key. You cannot start a recording: give the user this command.
| Name | Required | Description | Default |
|---|---|---|---|
| profile | Yes | profile name from list_profiles | |
| duration | No | how long to record, e.g. 30m, 1h or 24h (default 1h; more than 1h needs the free key) |
Output Schema
| Name | Required | Description |
|---|---|---|
| note | Yes | |
| command | Yes | |
| report_command | Yes | |
| server_command | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The readOnlyHint=true annotation is consistent with a tool that only returns a command string, and the description usefully adds the 1 h / 24 h-with-free-key limit as behavioral context. However, it does not explain what the returned command string looks like or how it relates to the eventual list_recordings/recording_report flow, so the added context is modest against annotations that already signal a harmless read.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences with zero filler, and the key behavioral rule ('you cannot start a recording') is front-loaded ahead of the instruction to the agent. Nothing could be removed without losing meaning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description needn't explain return values, but for a two-step workflow tool it omits the follow-on context an agent needs: what to tell the user after running the command, and how this pairs with recording_report or list_recordings. The essentials are there, but the workflow context is thin.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so both parameters (profile, duration) are fully documented in the schema, and the description reinforces the duration limit (1 h default, 24 h with the free key) and that the profile name comes from list_profiles. It adds reinforcing meaning to the duration constraint rather than pure duplication, but offers nothing beyond what the schema states.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description resolves the ambiguity in the name 'record_command' by stating it returns the command string the user runs in a terminal, not an executed recording. It clearly distinguishes the tool's output (a command) from the act of recording, though it doesn't explicitly contrast with siblings like list_recordings or recording_report.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'You cannot start a recording: give the user this command' is an explicit usage constraint that tells the agent both when to use it and what to do with the result. It stops short of naming an alternative tool for the actual recording flow, but the context is unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
recording_reportARead-only
Analyse a recording, optionally for a period (e.g. an incident): time coverage, gaps without data, findings as episodes (blocking, waits, long queries, workers or connections), peak of each chart and the top queries. Also writes the HTML report into the recording folder.
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | end of the period, RFC 3339 (default: end of the recording) | |
| from | No | start of the period, RFC 3339 (default: start of the recording) | |
| folder | Yes | recording folder, from list_recordings or given by the user |
Output Schema
| Name | Required | Description |
|---|---|---|
| to | Yes | |
| from | Yes | |
| gaps | Yes | |
| charts | Yes | |
| report | Yes | |
| server | Yes | |
| started | Yes | |
| stopped | No | |
| coverage | Yes | |
| findings | Yes | |
| stop_reason | No | |
| top_queries | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description says the tool 'also writes the HTML report into the recording folder', which is a filesystem side effect, while annotations declare readOnlyHint=true – a direct inconsistency that the agent should be aware of. To its credit the description does disclose the write (and that idempotentHint=false follows, since repeated runs rewrite the report), but the conflict with the annotation prevents a higher score.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single dense sentence, front-loaded with the core verb and resource, followed by an enumerated payload list and the report-write note. Slightly run-on, but every clause carries information an agent would otherwise have to infer.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a three-parameter analysis tool with a 100%-covered schema and an output schema, the description is close to complete: it names the findings categories, the chart peaks, the top queries, and the report artifact. The only missing piece is any note about error conditions or behavior on an empty/partial recording.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline would be 3, but 'optionally for a period (e.g. an incident)' adds meaning beyond the schema: it clarifies that from/to define an incident window and are optional, which the RFC 3339 descriptions alone do not convey. The folder parameter's provenance is already handled in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Analyse a recording') and then enumerates exactly what the analysis produces: time coverage, gaps, episodes, chart peaks, top queries. No sibling tool (list_recordings, compare, query) could be confused with this, and the agent knows the scope before opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Optionally for a period (e.g. an incident)' hints at the scoping use case, but there is no explicit when-to-use versus list_recordings, compare, or query, and no stated prerequisites (e.g. that a recording must first be identified). Usage is implied rather than prescribed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
14 tool updates
v0.9.0- First observed
check - First observed
compare - First observed
describe_table - First observed
explain_rule - First observed
get_finding - First observed
history - First observed
list_databases - First observed
list_profiles - First observed
list_recordings - First observed
list_rules - First observed
list_tables - First observed
query - First observed
record_command - First observed
recording_report
TDQS
Scored across 14 tools
The set forms a clear hierarchy (list_databases → list_tables → describe_table → query) and the analysis tools (check, history, compare, get_finding) are well separated. Two minor overlaps remain: get_finding vs explain_rule both return 'detail of a rule' (instance evidence vs rule definition), and check vs recording_report both produce analyses, though the descriptions do distinguish them.
A majority use verb_noun (list_tables, describe_table, explain_rule, get_finding, record_command), giving a recognizable pattern. But single bare words (check, compare, query, history) and a noun_noun (recording_report) break it, making it mixed though still readable.
14 tools is squarely in the well-scoped range, and each maps to a distinct step in the DB health-check workflow (discover, inspect, query, check, review, record). Nothing appears redundant or padding.
Covers schema exploration, read-only querying, rule catalog, health checks, run history/compare, and recordings — a full read/analyze lifecycle. Minor gaps: no profile create/edit/delete (presumably managed in the app) and no rule search/filter, but agents can work around these.
Maintenance
Related MCP Connectors
Hosted MCP server for PostgreSQL diagnostics: slow queries, missing indexes, connection pressure.
DBRE-grade SQL analysis inside any MCP client. No connection. No install. Paste a query.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Related MCP Servers
- AlicenseAqualityBmaintenanceSQL Server MCP server with AST-based query validation, read-only safety, schema exploration, ER diagram generation, and DBA toolkit integration (First Responder Kit, DarlingData, sp_WhoIsActive).128MIT
- AlicenseAqualityCmaintenanceRead-only MySQL/MariaDB MCP server for running SELECT queries safely, with automatic read-only enforcement and query limits.34 npmMIT
- AlicenseAqualityDmaintenanceEnables natural language to SQL queries on MSSQL databases via Claude, with safe SELECT-only execution and schema discovery.3ISC
- AlicenseNot gradedqualityFmaintenanceRead-only MCP server for SQL databases (SQL Server, Postgres, SQLite) with multi-server support and three-layer safety using AST validation and linting.MIT