Skip to main content
Glama

patch_concept

Revise, deepen, or reclassify an existing ontology node by patching its frontmatter and body; use expected_mtime to guard against concurrent edits.

Instructions

Update the frontmatter and/or body of an existing ontology node. Use when an AI agent revises, deepens, or reclassifies a node. Frontmatter patches are key-by-key — null deletes a key, omission preserves it. Body is fully replaced when provided, otherwise preserved. Pass expected_mtime (from the previous get_concept response) to detect concurrent external edits — throws VaultConflictError if the file has changed on disk since you read it. Changed writes return compact postWriteMaintenance (maintenance_plan) with count-safe byPhase / bySeverity / byKind queue buckets, action score, executable proposedAction, and current-page nextExecutableAction / nextReviewAction pointers so agents can immediately continue graph cleanup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyNoFull replacement markdown body (optional). Preserved when omitted.
slugYesVault-relative slug (omit the .md extension).
frontmatterNoFrontmatter key/value patches (e.g. { kind: "capability", domain: "views" }). null removes the key. Per-locale display names go here as `display_ko` / `display_en` — fill every locale the vault serves so both audiences read a native name (`title` stays the search/matching source).
expected_mtimeNoOptional conflict guard. If the file mtimeMs differs at write time, the call throws so the caller can re-read and retry. Pass the `mtime` field from the most recent get_concept response.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
slugYes
changedYes
filePathYes
postWriteMaintenanceYesCompact maintenance_plan summary for post-write follow-up. Bucket maps describe the remaining queue after the write.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.13.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false, leaving significant behavioral detail to the description. The description fully transparently explains the patch semantics: 'Frontmatter patches are key-by-key — null deletes a key, omission preserves it. Body is fully replaced when provided, otherwise preserved.' It also discloses the conflict-detection error (VaultConflictError) and the structure of the returned postWriteMaintenance object, giving the agent a complete picture of the tool's runtime behavior.

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?

The description is front-loaded with the core action, then systematically covers usage, patch semantics, conflict handling, and return value structure. Every sentence contributes operational or strategic information. While lengthy, the length is justified by the tool's complexity and the need to clearly explain non-obvious behavior (key-by-key patching, conflict detection, postWriteMaintenance). No filler or redundancy.

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

Completeness5/5

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

Given the tool's complexity (4 params, nested object, conflict behavior, response details) and the presence of an output schema, the description is exceptionally complete. It covers when to use, how parameters behave, what errors to expect, and what the response contains (maintenance_plan with byPhase/bySeverity/byKind queues and pointer fields). An agent has all necessary information to invoke the tool correctly and handle outcomes.

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

Parameters5/5

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

Although schema description coverage is 100% (all parameters have schema-level descriptions), the tool description adds substantial semantic nuance beyond the schema. It explains the key-by-key frontmatter behavior (null deletes, omission preserves), the body replacement semantics, and the purpose of `expected_mtime` as a conflict guard. This enriches parameter understanding and guides correct values (e.g., per-locale display names in frontmatter).

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 and resource: 'Update the frontmatter and/or body of an existing ontology node.' It explicitly targets existing nodes, distinguishing it from creation (add_concept) and deletion (delete_concept) tools. It also signals the intended use case ('revises, deepens, or reclassifies'), which differentiates it from related siblings like rename_concept or reclassify_concept.

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?

The description clearly states 'Use when an AI agent revises, deepens, or reclassifies a node.' This gives explicit context for when this tool is appropriate. It does not explicitly name alternative tools or list when-not-to-use conditions, but the scenario phrasing helps an agent decide. The addition of `expected_mtime` conflict guard also provides practical usage guidance.

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