Skip to main content
Glama

Sor Add Layer

sor_add_layer

Adds a new layer to an existing SOR config by defining mutable file paths, contract tests, and optional scored metrics or thresholds for controlled code optimization.

Instructions

Add a new layer to an existing SOR config.

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": {
      "project_dir": "<project_dir>",
      "name": "<name>",
      "surface": "<surface>",
      "contracts": "<contracts>"
    },
    "name": "sor_add_layer"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesLayer name (must be unique).
scoredNoWhether this layer uses scored metrics.
metricsNoList of {name, extract, weight} dicts (required if scored=True).
surfaceYesList of mutable file paths.
contractsYesTest file path/glob for contract tests.
thresholdsNoOptional {target_score, max_attempts, ...} overrides.
project_dirYesPath to the project directory containing sor.yaml.
scored_testsNoTest file for scored metrics (required if scored=True).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden and discloses almost nothing: it does not say whether this validates names, fails on duplicates, mutates sor.yaml atomically, or whether the new layer affects subsequent ratchet/score runs. The only behavioral hints (uniqueness of name, metrics and scored_tests required when scored=True) come from the schema, not the description. For a write operation against a config file, this is a significant gap.

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?

A single clean sentence with no padding and the action front-loaded. It is brief rather than padded, though the brevity is a symptom of under-specification rather than disciplined editing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An 8-parameter mutation tool with no annotations and no output explanation needed (an output schema exists), yet the description says nothing about preconditions, failure modes, or side effects on the config. Given the tool's complexity, an agent knows what it does nominally but not how to call it safely.

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

Parameters3/5

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

Schema description coverage is 100%, including the conditional dependency '(required if scored=True)' for metrics and scored_tests, so the schema already does the semantic work. The description adds nothing beyond the schema, so the baseline of 3 applies.

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 ('Add a new layer') and constrains it to 'an existing SOR config', so the object of the mutation is unambiguous. It does not differentiate itself from the surrounding sor_* tools (init, status, ratchet, run_oracle), so an agent gets no explicit signal about whether this is setup, mutation, or read.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance at all. It does not say whether sor_init must run first, whether the layer must already be referenced elsewhere, or what an agent should do instead if the layer already exists, which matters given the sibling sor_* tools that also touch the same config.

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