Skip to main content
Glama
semlayer MCP server

semlayer MCP server

infer

Build a semantic layer for a warehouse by modeling metadata and sample values, scoped to selected schemas, so AI agents can query with correct business context.

Instructions

Build the semantic layer for a warehouse. Ask the user first.

    This READS THEIR WAREHOUSE -- metadata and sample values -- under the
    connection given, and on a real warehouse it takes minutes and uses
    their own LLM key, which costs them money. Ask before calling it, and
    say which warehouse you are about to model.

    connection: a uri from `status.connections`, or one the user gave.
    Omit it to use the session's.
    question: what the user actually asked. Keep it here: when the layer
    is ready, `status` reminds you to answer it, so a run that outlives
    this turn does not lose the point of itself.
    scope: schema names, comma-separated, to model only those. The way to
    make a big warehouse finish quickly.
    wait_seconds: how long to hold this call open (capped at 60). A DuckDB
    file finishes inside it and comes back `ready`, so you can answer in
    the same turn. Anything larger comes back `inferring`.
    use_llm: false for a statistics-only layer -- no descriptions, no
    decode validation, no cost, and much faster.

    While this call is open it streams progress notifications, so a
    client that renders them shows a bar. Nothing will wake you AFTER it
    returns. Tell the user that, and call `status` when they next speak.
    

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": "infer"
  }
}

Input Schema

NameRequiredDescriptionDefault
scopeNoSchema names, comma-separated, to model only those.
use_llmNoFalse for a statistics-only layer: no descriptions, no LLM cost, much faster.
questionNoWhat the user actually asked, kept so `status` can remind you to answer it when the layer is ready.
connectionNoA uri from `status.connections`, or one the user gave. Omit it to use the session's.
wait_secondsNoHow long to hold this call open, in seconds. Capped at 60.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.1
    • addedInput schema / properties / connection / description
      Added value: +"A uri from `status.connections`, or one the user gave. Omit it to use the session's."
    • addedInput schema / properties / question / description
      Added value: +"What the user actually asked, kept so `status` can remind you to answer it when the layer is ready."
    • addedInput schema / properties / scope / description
      Added value: +"Schema names, comma-separated, to model only those."
    • addedInput schema / properties / use_llm / description
      Added value: +"False for a statistics-only layer: no descriptions, no LLM cost, much faster."
    • addedInput schema / properties / wait_seconds / description
      Added value: +"How long to hold this call open, in seconds. Capped at 60."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, openWorldHint=true, destructiveHint=false) by disclosing that it reads warehouse metadata and sample values, can take minutes, consumes the user's own LLM key and costs money, streams progress notifications during the call, and will not wake the agent after it returns. The `ready` vs `inferring` outcomes tied to wait_seconds are exactly the kind of operational context annotations cannot carry.

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 most important constraint ('Ask the user first', cost, duration) is front-loaded, then each parameter gets one tight clause. The piece runs long, but nearly every sentence carries action-guiding information; only the progress-notification paragraph is arguably padded with client-rendering detail.

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 zero-required-param, potentially costly long-running operation with an output schema, the description covers cost, duration, consent, progress, timeout, and post-call follow-up. Nothing an agent needs to invoke 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, but the description adds operational meaning beyond the schema: wait_seconds explains that a DuckDB file finishes inside the window and returns ready while larger targets return inferring, scope is framed as the lever for making a big warehouse finish quickly, and question's persistence role is spelled out. This is genuine added value, not repetition.

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?

States a specific verb and resource — 'Build the semantic layer for a warehouse' — which is clearly distinct from siblings like load_layer, save_layer, export_layer, and status. The opening line is front-loaded and unambiguous about what the call produces.

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?

Explicitly instructs 'Ask the user first' and to say which warehouse is about to be modeled, plus when to call `status` afterward. It does not, however, contrast this with load_layer/save_layer (loading or persisting an existing layer), so the agent must infer that boundary from sibling names alone.

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