Picking the environment and database for a sql-server MCP call from describe_environments. Use when a task needs data from a sql-server registration, the environment or database is unclear, or a call was refused for its environment or database.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Choose Environment?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/melodic-software-choose-environment)
---
name: choose-environment
description: "Picking the environment and database for a sql-server MCP call from describe_environments. Use when a task needs data from a sql-server registration, the environment or database is unclear, or a call was refused for its environment or database."
disable-model-invocation: false
---
# Choose an environment and database
## Workflow
- Call `describe_environments` before the first data call of a task, and again when the person
names an environment or database its answer did not show. It lists each environment this
registration serves with its database names and patterns, its default database, its read mode,
whether it is local and its reads are checked by the reject list, its write and script modes,
and the limits in force. It reaches no database, so it is safe to call at any point.
- Name `environment` on every data call unless the registration serves only one environment.
With more than one, a call that leaves it out is refused before it connects.
- Name `database` whenever the task is about a particular database. A read that names none runs
in the environment's default database when it has one, which may not be the one the person
means; without a default the read is refused until it names one. `describe_environments` shows
the default. A write must name it when the environment allows more than one database, and a
pattern counts as more than one.
- When the environment lists a pattern, use the concrete database name the person or the data
gave you. Never invent a name to fit the pattern.
- Take the limits in force from `describe_environments` and from each result, never from memory:
they can differ per environment.
The tools are written here by their bare names. A client shows them under a prefix formed from
the name the consumer gave the registration; for the form Claude Code uses, see
[MCP permission rules](https://code.claude.com/docs/en/permissions#mcp).
## Read the environment's modes
The read mode says what stands between a read and a data change. Tell the person which one
applies when it matters to the task.
- `read-only-principal`: reads run on a login with read grants only, so the login keeps the
environment read-only. This is the strictest mode.
- `impersonated-reader`, when an environment reports it: the login can do more, and each read
runs as a reader user inside the database, with the reject list in force unless
`describe_environments` reports `read.validate` false (local environments only).
- `filtered-admin`: reads run on a login that can change data, and the reject list is the only
read control, so the environment is not read-only. A local environment that reports
`read.validate` false has no read control at all. Keep every read plain there. When the person
relies on the environment staying unchanged, say that a stricter read mode is a configuration
and database change they can choose; never refuse a read because of the mode.
The write and script modes say whether those tiers are open. When they show writes or scripts
off, tell the person instead of trying the call.
## When a name is not on the list
An environment or database outside the allow-list is refused before any connection opens; only
`list_databases` on Azure SQL Database reads `master`, with fixed SQL, to list the names. Do not
try near spellings: tell the person which names the registration serves. Reaching another
environment takes a registration a person makes, and changing the allow-list or the config is the
person's act, not the agent's.
Every refusal carries a `next` step: read the message and do that step.
## Next
- The task reads data: the query-safely skill.
- The task changes rows: the write-rows skill.
- The task runs a multi-statement script: the run-scripts skill.
## Related
- No sql-server registration is available, or a call reports that the config is invalid: the setup skill.
## Gotchas
- A read that leaves out `database` runs in the default database when the environment has one,
so a table the person meant in another database comes back as an invalid object or as the
wrong rows. Name the database.
- Databases matched by a pattern are not listed one by one. `describe_environments` shows the
pattern; the concrete name has to come from the person or from data already read.