Skip to main content
Glama

Refresh the datasource schema

refresh_schema

Refresh schema from datasource and auto-select new tables/columns. Use after execute() to make new tables visible to other tools. The refresh runs in the background, so this is a two-step tool: call it ONCE with no poll argument to start the import, then call it with poll: true until state is "complete" or "failed". poll: true only reads the run — it never starts one — and reports state, stage and tables_completed of tables_total, plus the result summary (tables added/removed, columns added, relationships, and any PII fields held_back for human review) once the state is "complete". A poll on a datasource with no import on record answers state "no_run". WITHOUT poll the call is a request, not a read: it reports a refresh that is still running, but on a run that has finished it starts a new full import of the datasource. Never loop on that form.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "refresh_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
pollNoRead the current import's state without starting anything (default: false). This is how you follow a refresh to completion: poll: true never begins an import, so it is safe to call in a loop and safe to retry.
datasourceNoOptional datasource ID to target. Omit to use the project's configured default; required when the project has multiple datasources and no default is configured. Each datasource has its own SQL dialect: get_schema lists every datasource with its type, dialect and identifier quote, and every result carries datasource_type and dialect. A datasource that has not finished setup is refused with datasource_not_ready.
auto_selectNoAutomatically select all new tables/columns (default: true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare readOnly=false, idempotent=false, destructive=false; the description explains why non-idempotency exists — a non-poll call on a finished run starts a brand-new full import — and that the import is asynchronous. It also discloses the 'no_run' state and that PII fields are held_back for human review. It stops short of stating permissions or what happens to existing exposure settings, keeping it at 4 rather than 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?

The critical protocol and the loop hazard are front-loaded, and the dense single paragraph is justified by the tool's unusual two-mode behavior. Minor redundancy: the never-loop warning is stated twice ('Never loop on that form' restates the earlier warning), which could be tightened.

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?

No output schema exists, and the description compensates by describing the poll response (state, stage, tables_completed of tables_total, result summary with tables added/removed, columns, relationships, held-back PII). For an async mutation tool with no annotations carrying behavioral weight, nothing an agent needs to call it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description nevertheless adds meaning beyond the schema by contrasting the two modes — poll:true is a pure read, while the default (no poll) is a request that can trigger a fresh full import. That distinction is not stated in the schema's poll description and materially changes how the parameter is used.

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?

Opens with a specific verb and resource ('Refresh schema from datasource') and adds the side effect ('auto-select new tables/columns'), then distinguishes itself from siblings by saying it makes new tables visible to other tools after execute(). An agent can tell what this does 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 Guidelines5/5

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

Gives explicit when-to-use ('Use after execute()'), a full two-step invocation protocol, and a hard exclusion: never loop on the non-poll form. The alternative forms of the same tool are separated by condition rather than 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