Skip to main content
Glama

artifact_write

Create or update validated KB-root artifact files, enforcing schemas and conflict checks so writes succeed only with correct content and version hashes.

Instructions

Creates or updates a KB-root artifact file (skills//, agents/.md, hooks/, mcp/.json, instructions.md, templates/.md, paths.yaml, glossary.yaml). On an existing file, if_match is required (sha256 of the current content, from artifact_read/artifact_list) — fails with stale_write if it's missing or doesn't match. On a new file, omit if_match — fails with already_exists if the file is actually already there. Validates structured artifacts, including template frontmatter and variables the paths.yaml schema (paths:/repos: key -> {description, default: ~/…, remote}) and the glossary.yaml schema (terms: list of {canonical, aliases: [..], forbidden: [..]}), before writing.

Input Schema

NameRequiredDescriptionDefault
pathYesPath relative to the KB root, e.g. skills/my-skill/SKILL.md
reasonNoWhy (commit trailer)
contentYesNew file content, text by default or base64 when encoding is base64
encodingNoContent encoding; defaults to text
if_matchNoExpected sha256 of the current content — required when overwriting an existing file, omit when creating a new one
executableNoOptional executable bit; omitted preserves an existing file mode and defaults false for a new file

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it names the failure modes (stale_write on missing/mismatched if_match, already_exists when a supposedly-new file is present) and discloses that structured artifacts are validated against paths.yaml and glossary.yaml schemas before writing. It omits permission/auth requirements and any note on reversibility, so it is strong but not exhaustive.

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 and scope are front-loaded, and the create-vs-update semantics follow logically. The parenthetical path lists and schema digests make the single paragraph heavy, but every clause carries operative information rather than filler.

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 mutation tool with no annotations and no output schema, the description covers scope, concurrency (if_match), failure modes, and validation behavior well enough to invoke correctly. It does not describe what the tool returns on success, though that is a minor gap given no output schema exists to lean on.

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?

Schema coverage is 100%, so the baseline is 3, but the description goes beyond the schema by surfacing the actual error codes for if_match misuse and by cross-referencing artifact_read/artifact_list for obtaining the hash. It also documents the paths.yaml/glossary.yaml validation expectations that constrain the content parameter.

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?

States a specific verb+resource ('Creates or updates a KB-root artifact file') and enumerates the exact path families in scope (skills/<slug>/**, agents/<slug>.md, hooks/**, mcp/<slug>.json, etc.). This scope enumeration lets an agent distinguish it from sibling write tools like concept_write and asset_write without opening schemas.

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?

Gives clear create-vs-update branch logic: include if_match to overwrite an existing file, omit it to create a new one, and points to artifact_read/artifact_list as the source of the sha256. It does not explicitly say when to prefer this over sibling write tools such as concept_write or asset_write, so it falls short of full when/when-not guidance.

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