Skip to main content
Glama

select_schema

Read-onlyIdempotent

Start here for any question about the data. Returns the few tables and views the question needs, as compact DDL to write SQL against, scoped to the caller: objects and columns they may not read are absent, not ranked low. Also returns each object's name and why it was picked. Pass principal and roles whenever you know who is asking.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rolesNoThe caller's roles or groups, e.g. ['finance', 'payroll']. Objects and columns restricted to a role are visible only when it is listed here. Omitted = no roles.
top_kNoHow many tables and views to select for the question (default 6). Raise it for questions that span many areas; the caller's visible objects are the upper bound.
questionYesThe user's question in plain language, e.g. 'revenue by month' or 'which customers owe us money'.
principalNoWho is asking, as an identity string such as 'okta:jdoe'. Pass it whenever you know the user: visibility is decided for this identity. Omitted = anonymous, which sees only unrestricted objects.
expand_foreign_keysNoAlso pull in tables joined by foreign key to the selected ones (default true), only where the caller may read them. Set false for the bare top matches.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover read-only/idempotent/non-destructive/non-open-world, so the bar is lower. The description nonetheless adds real behavioral context: results are scoped to the caller and unauthorized objects/columns are 'absent, not ranked low,' which tells the agent how to interpret a sparse result set. It does not add limits or failure behavior, keeping it below 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.

Conciseness4/5

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

Three tight sentences, front-loaded with the entry-point instruction and no filler. 'Also returns each object's name and why it was picked' is partly redundant given an output schema exists, which keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and 100% param coverage, the description only needs to supply scope, auth semantics, and entry-point guidance, all of which it does. The one remaining gap is its silence on how it relates to run_query (the natural next step), which is what keeps it off a 5.

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 description coverage is 100%, so the schema already documents question, principal, roles, top_k, and expand_foreign_keys in detail. The description reinforces principal/roles ('Pass ... whenever you know who is asking') but largely restates what the schema fields already say, so baseline 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?

Names a specific action (return the few tables/views a question needs as compact DDL) plus the caller-scoped selection rule, and the opening 'Start here for any question about the data' clearly separates it from list_objects, describe_object, and run_query. An agent can tell what this produces without 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.

Usage Guidelines4/5

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

'Start here for any question about the data' gives a clear entry-point rule, and 'Pass principal and roles whenever you know who is asking' gives a conditional usage instruction. It does not explicitly name siblings or state when to prefer list_objects/describe_object/run_query instead, so it falls short of full alternative routing.

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