Skip to main content
Glama

knowledge_write

Create or overwrite Markdown files in the knowledge base using expected-hash conflict checks to avoid overwriting content changed since your last read.

Instructions

Создать или перезаписать .md в базе. Если передать expected_hash из knowledge_read и файл изменился — вернётся conflict и записи не будет. expected_hash="new" требует, чтобы файла не было.

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": {
      "path": "<path>",
      "content": "<content>"
    },
    "name": "knowledge_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
contentYes
expected_hashNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does disclose real behavior: a hash mismatch aborts the write and returns a conflict, and "new" enforces non-existence. This reveals atomicity/conditional-write semantics rather than just restating the name. It still omits permission requirements, what happens to prior content on overwrite, and the response shape after success.

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?

Three short sentences with the purpose front-loaded and the conditional semantics following logically. No filler or repetition, though the terse phrasing leaves gaps that a slightly longer definition could close.

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?

This is a mutation tool with no annotations and no output schema, so the description must cover safety and return behavior itself. It handles the concurrency-conflict path well but never explains how a caller obtains the hash on a first write, nor what a successful call returns.

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 0%, so the description must compensate. It explains expected_hash well, including its two valid modes, but says nothing about the path format (beyond being a .md in the knowledge base) or content constraints such as encoding or size limits.

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 description states a specific verb and resource: create or overwrite a .md file in the knowledge base. 'Overwrite' implicitly distinguishes it from the append-style sibling, but no sibling is named explicitly, so the differentiation is inferred rather than stated.

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 gives concrete conditional guidance on the expected_hash parameter — take it from knowledge_read for optimistic concurrency, or use "new" to assert the file must not exist — which tells the agent when each mode applies. It does not, however, say when to prefer this tool over knowledge_append for non-overwriting writes.

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