Skip to main content
Glama

db_scope_list

Read-onlyIdempotent

List the table scopes a project has on record (scopes: recorded declarations, which a deploy that did not complete can leave behind) beside live_rules, the rules the live version actually serves, plus tables that LOOK like per-user data (a user_id/owner_id-style column) with no scope on record. An entry in unscoped_user_tables is a finding to inspect under the table's actual access contract, not a verdict: on a managed project the contract is the table's declaration in db/schema.ts (and structured queries on an undeclared table are refused, not run unscoped); on a SQL-mode project it is what db_scope_set recorded, and raw SQL in server functions is unscoped by design. Developer-only.

Example:

{ "project_id": "my-saas" }
// Returns: { "scopes": [{ "table": "bookings", "owner_column": "user_id", "intent": "scoped", ... }], "unscoped_user_tables": [{ "table": "notes", "owner_column": "user_id" }] }

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "project_id": "<project_id>"
    },
    "name": "db_scope_list"
  }
}

Input Schema

NameRequiredDescriptionDefault
project_idYesProject ID (UUID), subdomain, or slug — resolved server-side, no UUID lookup needed. 'default' also works when the account has exactly one project; multi-project accounts must name one (the error lists them).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, yet the description adds real behavioral context: `scopes` can be stale leftovers from an incomplete deploy, managed projects refuse structured queries on undeclared tables, and raw SQL in server functions is unscoped by design. It also adds an access restriction (developer-only) that annotations do not carry. Only the return-format handling keeps it short of 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every clause carries information (definition of scopes, the live_rules contrast, the stale-deploy caveat, the managed-vs-SQL-mode contract), and the example compactly shows the return shape. The first sentence is a heavily nested run-on with stacked parentheticals, which costs some readability.

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?

For a one-parameter read-only tool with no output schema, the description covers what each returned key means, how to interpret the notable one (`unscoped_user_tables`), and the caveats that would otherwise cause misreading. Nothing an agent needs to call and interpret it is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the single parameter `project_id` is fully documented there, including the 'default' fallback and multi-project error behavior. The description adds nothing about the parameter beyond echoing a `"my-saas"` value in the example, so the baseline of 3 applies.

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 names a specific verb (list) and three specific resources it returns: `scopes` (recorded declarations), `live_rules`, and `unscoped_user_tables` filtered to tables with an owner-style column. It even defines the semantic difference between `scopes` and `live_rules`, so an agent can distinguish this read/audit tool from the sibling `db_scope_set` writer.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives interpretive guidance for results ('a finding to inspect ... not a verdict') and an audience restriction ('Developer-only'), which implies an audit/review use case. But it never states when to call this instead of `db_scope_set`, `db_describe`, or `db_query`; the routing to alternatives is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources