Skip to main content
Glama

lesson_patch

Destructive

Replace one unique substring in a materialized lesson.

Instructions

Replace one unique substring in a materialized lesson.

old_string must occur exactly once within the lesson's markdown body. The operation preserves the lesson's heading, summary, provenance, and timestamps, unlike a wholesale lesson_append replacement. For target="summary", old_string must equal the entire current summary and new_string must be a nonempty single line without markers. A recovery pre-image is saved before the change.

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": {
      "slug": "<slug>",
      "old_string": "<old_string>"
    },
    "name": "lesson_patch"
  }
}

Input Schema

NameRequiredDescriptionDefault
slugYes
targetNobody
new_stringNo
old_stringYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.30.0
    • addedInput schema / properties / target
      Added value: +{
      +  "default": "body",
      +  "title": "Target",
      +  "type": "string"
      +}
  2. Addedv0.17.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and idempotentHint=false, but the description adds genuinely non-obvious behavior: it preserves heading, summary, provenance and timestamps, and a recovery pre-image is saved before the change. That rollback information is exactly the kind of context the annotations cannot carry. It stops short of describing what happens when old_string is not unique or the tool errors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four tight sentences, front-loaded with the core operation before the constraints. The 'unlike a wholesale lesson_append replacement' clause and the pre-image sentence each carry distinct information, so nothing is wasted.

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 four-parameter destructive mutation the description covers the essential semantics: uniqueness requirement, target-specific rules, preservation guarantees, and recovery. An output schema exists so return values need not be explained, but the meaning of 'slug' and the behavior on non-unique matches remain unstated.

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?

With 0% schema description coverage, the description does real work: it constrains old_string to a single occurrence, explains target="summary" semantics (old_string must equal the entire summary, new_string must be a nonempty single line without markers), and thereby implies the default 'body' target. Only 'slug' is left undocumented, and the full set of legal target values is never enumerated beyond the one example.

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 first sentence gives a precise verb and resource ('Replace one unique substring in a materialized lesson') and the second explicitly contrasts the operation with a wholesale 'lesson_append' replacement, so an agent can distinguish it from the sibling without opening either schema.

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

Usage Guidelines3/5

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

It states the precondition that old_string must occur exactly once and gives a specific rule for target="summary", which implies when the tool is applicable. However, there is no explicit statement of when to prefer this tool over lesson_append or lesson_restore beyond the passing contrast, and no guidance on failure cases or prerequisites.

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

Deploy Server

Other Tools