schemagate
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SCHEMAGATE_MEMORY | No | Enables memory of question-SQL pairs. Set to a path or '1' for ~/.schemagate/memory/<db>.jsonl. Off by default. | |
| SCHEMAGATE_MCP_PORT | No | Port for the streamable-http transport. Used when SCHEMAGATE_MCP_TRANSPORT=streamable-http. | |
| SCHEMAGATE_AUDIT_LOG | No | Enables audit logging. Set to a file path, or '1' for ~/.schemagate/audit.jsonl. Off by default. | |
| SCHEMAGATE_DATABASE_URL | Yes | Database URL to connect to. Set to 'demo' to serve the bundled sample schema. | |
| SCHEMAGATE_AUTO_EMBEDDER | No | Set to '0' to force the hashed embedder even if schemagate[huggingface] is installed. | |
| SCHEMAGATE_MCP_TRANSPORT | No | MCP transport. Use 'stdio' (default) or 'streamable-http' for HTTP. | stdio |
| SCHEMAGATE_CATALOG_CONFIG | No | Path to a catalog configuration JSON file. Can contain 'restrict', 'hint', and 'groups' blocks. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| select_schemaA | 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. Pass principal and roles whenever you know who is asking. Returns 'ddl' (put it in your SQL prompt), 'objects' (the names chosen), 'explain' (score and reason per object) and 'selected' / 'total_objects'. Reads table structure only, never rows. Next: write one SELECT against 'ddl' and call run_query with the same principal and roles; call describe_object if a table needs more columns than the compact DDL shows. If the right table is missing, raise top_k or rephrase rather than writing SQL against a table that was not returned. |
| list_objectsA | List every table and view this caller may read: 'objects' holds each one's name, kind (table or view), column count and description, with 'count' visible out of 'total_objects'. Use it to show what data exists, or when select_schema did not return what you expected. It returns no DDL and no rows, and on a large database it is long: to answer a question, call select_schema instead. Pass principal and roles; restricted objects are absent for callers without the role. |
| describe_objectA | Full DDL (all visible columns, keys, comments) for one table or view, if the caller may read it. Use it when select_schema's compact DDL is not enough. A restricted or missing object returns the same 'not available' error, so its existence is not revealed. |
| run_queryA | Execute one read-only SELECT and return the rows (capped by max_rows). Write the SQL against the DDL select_schema returned for the same caller. Refuses writes, multiple statements, and any table or column the caller may not read, with an error that says so ('not available to this caller'), which you can pass on to the user instead of reporting 'no results'. |
| semantic_queryA | For questions about what text says when no column records it, e.g. 'which complaints ask for a refund'. Runs one read-only SELECT through the same checks as run_query, then has the server's model read one text column of the returned rows and either keep the rows that meet a criterion or add a short answer per row. Returns columns, rows, how many rows were judged, and which text was sent to the model. Off unless the server enables it (SCHEMAGATE_MCP_SEMANTIC=1), because the row text goes to the model provider; at most 200 rows are judged. Use plain run_query whenever a column already holds the answer. |
| answerA | Question in, rows out: selects the schema, writes the SQL with the server's own configured model, and runs it, all scoped to the caller. Only available when the server has a model configured; most clients should use select_schema then run_query with their own model instead. |
| refresh_catalogA | Re-read the database structure (new tables, changed columns, changed grants) and swap the index in. Call it after a migration or a permission change, or when health shows the catalog is stale; it is not needed before ordinary questions. Takes no arguments, never changes the database, and can take seconds on a large schema. Returns {ok: true, objects, seconds}. If the database is unreachable it returns {ok: false, kept_previous: true, error}: the previous catalog stays in service. |
| healthA | Server status: whether the catalog is loaded, how many objects it holds, the database dialect, and audit-log counts. Takes no arguments; safe to call any time. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 8 tools
Each tool has a distinct role, and the descriptions explicitly steer callers between the overlapping-looking paths (answer vs. select_schema + run_query, semantic_query vs. run_query). The main ambiguity is that answer and semantic_query both involve the server's model, but the guidance on when to prefer each is clear enough.
All names use snake_case and are readable, with most following a verb_noun pattern (select_schema, run_query, describe_object, list_objects, refresh_catalog). The standalone nouns 'answer' and 'health' are minor deviations but remain clear.
Eight tools is well within the sweet spot for a read-only schema-gateway server. Discovery, schema selection, description, querying, semantic filtering, catalog refresh, and health each earn a place without redundancy.
The read-only lifecycle is well covered: list objects, select relevant schema, describe objects, run queries, optionally semantic-filter, refresh catalog, and check health. Minor gaps might include explicit SQL validation or richer pagination controls, but agents can work around these.