codeDB Lens
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CODEDB_LENS_NO_UPDATE | No | Set to 1 to turn off the optional once-a-day version check against GitHub Releases. The CLI equivalent is --no-update-check. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
codeDB Lens: read-only health checks for SQL Server and PostgreSQL. Nothing you call here changes a database or any configuration. Connections come from the user's saved profiles (list_profiles); passwords are never shown. check runs the diagnosis (10-60 s) and saves the report in the profile's history; get_finding gives the full evidence. A finding is Confirmed or a Hint; "no data" means the rule could not run (permissions, platform), never "OK". Recordings are started by the user in a terminal (record_command); you read them with recording_report. For data questions: list_tables, describe_table, then query with one SELECT that aggregates in SQL. query is read-only and stops at the profile's row limit; truncated: true means a partial answer, so refine and ask again.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| checkB | 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. |
| compareA | 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). |
| describe_tableA | 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. |
| explain_ruleA | 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. |
| get_findingA | 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. |
| historyA | 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. |
| list_databasesA | Databases this profile's login can open: name, state, recovery model or encoding, collation and size in bytes. |
| list_profilesA | List the saved connection profiles you may use: name, engine, host, initial database and language. Never returns passwords or connection strings. |
| list_recordingsA | 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. |
| list_rulesA | List the Lens rule catalog (health checks): ID, engine, category, severity and title. Kind "series" rules judge recordings, the others run in a check. |
| list_tablesA | 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. |
| queryA | 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: counts and sums taken while other transactions are open can be off, so present them as approximate, not final. |
| record_commandA | 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. |
| recording_reportA | 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. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| diagnose | Run the health check on a profile and explain the biggest risks and what to do. |
| explore_data | Describe the tables of a database and suggest questions the data can answer. |
| incident | Read a recording over a period and explain what happened. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 14 tools
Most tools target distinct resources and actions, with a clear progression from list_tables to describe_table to query. Some overlap exists in the reporting cluster (list_recordings, history, recording_report, check, compare), but the descriptions largely disambiguate them.
The set is mostly consistent verb_noun naming (list_recordings, describe_table, get_finding, explain_rule, record_command). The single-word names query, check, compare, and history are minor deviations but still readable and conventional for their actions.
Fourteen tools is well within a reasonable range for a database health-check and query server. Each tool appears to earn its place across discovery, querying, checking, and reporting workflows.
The surface covers profile/database/table discovery, querying, health checks, history, findings, rule explanation, recordings, and comparisons. Minor gaps remain around creating or editing profiles and managing recordings directly, though users can work around these via the external registration/recording flow.