Skip to main content
Glama

Set mapping rule

layerz_set_mapping
Idempotent

Create or update an import classification rule (upsert by pattern) in this model's single mapping set ("one model = one set"; created on first use). pattern is a case-insensitive glob where * matches anywhere (Apport* prefix, *PERPLEXITY* contains, *641 suffix, exact 601000) tested against the keyed source field; target is the item display name or uid it routes to — or the literal __ignore__ to deliberately route matching rows nowhere (they classify as ignored and stop counting as unmapped); sign (natural | negate | absolute) adjusts the amount. To reuse a catalog's rules instead, import it first (layerz_import_mapping_template). Re-sync (or layerz_manage_integration { op: "update" }) to apply. Not available for read-only API keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
signNoSign convention applied to the matched amount (default natural).
targetYesTarget item display name or uid; `uid::entryUid` pins ONE list entry of a list-mode item (every matched row lands on that entry, ignoring the dimension column); or `__ignore__` to route nowhere on purpose.
patternYesWildcard-prefix or exact pattern, e.g. "Apport*".
summaryYesRequired: short human-readable note (3–100 chars) summarising what this change does. Shown as the label in the model version history. Be specific (e.g. "Renamed Revenue to Net Revenue", "Imported 2024 OPEX from Excel").
model_idNoTarget model UUID. Required for user-scoped API keys; ignored (or validated against scope) for model-scoped keys.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already provide idempotentHint: true and readOnlyHint: false. The description adds meaningful behavioral detail beyond this: upsert-by-pattern semantics, the mapping set being created on first use, case-insensitive glob matching, the special __ignore__ behavior that stops rows from counting as unmapped, and the need to re-sync to apply changes. No contradiction with annotations exists.

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 description is dense but well ordered: purpose first, then parameter semantics, then application/when-to-use guidance, then the read-only restriction. The parenthetical examples are helpful rather than filler. It is on the longer side, but each clause earns its place for a tool with nuanced behavior.

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 mutating mapping tool with no output schema, the description covers the essential invocation context: what the tool does, how pattern and target behave, special values, the one-set model constraint, the need to apply via re-sync, and the read-only key limitation. It does not describe the return value or behavior when a rule pattern already matches multiple rules, but those are not blocking for selection and correct invocation.

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 adds value by explaining pattern matching in detail (case-insensitive, prefix/contains/suffix/exact examples, tested against the keyed source field), elaborating on target's special __ignore__ value, and clarifying that sign adjusts the amount. This goes beyond the schema's shorter parameter descriptions.

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?

The description opens with a specific verb-resource pair: "Create or update an import classification rule (upsert by pattern)" in the model's single mapping set. It also clarifies the one-model-one-set constraint and implicitly distinguishes itself from the sibling import template by saying "To reuse a catalog's rules instead, import it first."

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?

It clearly explains when to use this tool for individual classification rules and points to layerz_import_mapping_template as the alternative for reusing a catalog's rules. It also states the follow-up requirement to re-sync or use layerz_manage_integration with op: "update", and notes that read-only API keys cannot use it. It does not exhaustively enumerate when not to use it, but the guidance is sufficient.

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