Skip to main content
Glama
knowledge-mcp

knowledge-mcp

by bmdy6

apply_change

Destructive

Apply a single local text replacement only after verifying the current version matches, preventing conflicting or stale edits to vault documents.

Instructions

Apply one local text replacement after checking the current version.

replaces lists existing documents absorbed into this one by the edit (for example a concept card folded into a topic article). They are deleted only after the patch is written, and the patched body must still hold at least 70% of their combined length.

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": {
      "scope": "<scope>",
      "path": "<path>",
      "expected_text": "<expected_text>",
      "replacement": "<replacement>"
    },
    "name": "apply_change"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
scopeYes
replacesNo
replacementYes
expected_textYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already flag destructive=true and idempotent=false, but the description adds genuinely new behavior: absorbed documents in `replaces` are deleted only after the patch is written, and the patched body must retain 70% of their combined length. That explains the ordering and the guard rail on the destructive part, which annotations alone cannot convey; the failure path on a version mismatch is still undisclosed.

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 purpose sentence is front-loaded and the `replaces` caveat follows logically; every sentence carries information. Slight loss for the odd line breaks and for spending most of the budget on one optional parameter while others go undiscussed.

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

Completeness3/5

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

An output schema exists so return values need not be described, and the destructive `replaces` path is well covered. However, for a multi-parameter destructive edit tool, the meaning of `scope` and `path`, plus what happens when `expected_text` does not match, remain gaps an agent needs.

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

Parameters2/5

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

Schema description coverage is 0% across five parameters, so the description must carry the load. It explains `replaces` thoroughly and hints that `expected_text` is a version check, but `path`, `scope`, and `replacement` receive no explanation at all, and `scope` in particular is left entirely undefined.

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?

The first sentence states a specific verb and action: apply one local text replacement, with a precondition (checking the current version). It clearly differs from siblings such as create_document or delete_document, but it never names the target resource explicitly (the document at `path`), leaving the object of the edit implicit.

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?

Usage is only implied: 'after checking the current version' signals that a version check must precede the call, and the mention of absorbed documents implies when `replaces` is relevant. There is no statement of when to prefer this tool over sibling edit or document-creation tools, nor when not to use it.

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