Skip to main content
Glama
semlayer MCP server

semlayer MCP server

save_layer

DestructiveIdempotent

Persist an inferred semantic layer as a file in your repository so teammates and later sessions share the same business context instead of a per-machine cache.

Instructions

Write the layer into the user's project so their team has it.

    The cache is per-machine; a file in the repository is what a
    colleague reads. From then on this session's verdicts land there.
    Ask where they want it rather than choosing for them. A file already
    at that path is replaced; a path that cannot be written comes back
    as `saved: false` with the reason.

    Refused on a set: a hub and its members are several files the user
    already chose the paths for, and one file cannot hold them.
    

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": {
      "path": "<path>"
    },
    "name": "save_layer"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesWhere to write the layer file, as the user chose it: for example `semantic/layer.yaml` in their repository. `~` is expanded and missing folders are created.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.1
    • addedInput schema / properties / path / description
      Added value: +"Where to write the layer file, as the user chose it: for example `semantic/layer.yaml` in their repository. `~` is expanded and missing folders are created."
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare a destructive, non-read-only, idempotent write, and the description adds real detail on top: an existing file at the path is replaced, an unwritable path returns `saved: false` with a reason, and set-valued layers are rejected. That said, it doesn't describe what "this session's verdicts" means concretely or whether the overwrite is recoverable.

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 key action and the cache-vs-repository rationale are front-loaded, and each subsequent sentence adds a distinct fact (overwrite, failure shape, set refusal). The middle paragraph is dense and slightly awkward ("this session's verdicts land there"), but there is no filler.

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?

For a single-parameter write tool with an output schema and full annotation coverage, the description covers overwrite semantics, failure signaling, and the set refusal case. The remaining gap is definitional rather than operational: a reader new to the domain won't know what a "layer" or a "set" is, though that may be established by sibling tools.

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 path parameter is already documented, yet the description adds meaningful operator behavior: prompt the user for the path rather than picking one, since the choice is theirs. Combined with the schema's `~` expansion and folder-creation notes, an agent has enough to construct the call.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Write the layer into the user's project") and frames the outcome (team-visible file vs per-machine cache), which distinguishes it from a transient/cache path. It doesn't explicitly contrast with the export_layer or load_layer siblings, so differentiation relies on inference from the names.

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?

Gives a clear when: when the result must be readable by a colleague in the repository rather than staying in the machine-local cache. It also gives a when-not ("Refused on a set: a hub and its members are several files...") and a behavioral instruction to ask the user for the location instead of choosing. It stops short of naming an alternative tool for the set case.

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