Skip to content

ollama_artifact_export_to_path

Export artifact to path. ARTIFACT. Writes the artifact’s EXISTING markdown to a caller-specified path with a provenance header prepended. No re-render, no model call. Path safety is strict: target_path must be absolute, must end in .md, must live under one of allowed_roots (REQUIRED — caller declares intent). Overwrite is opt-in: existing files refuse by default so re-runs never clobber hand-edits. Not a generic file writer — export is the single handoff move.

Parameter Type Required Default Description
pack "incident_pack" \ "repo_pack" \ "change_pack" yes
slug string yes Source artifact slug.
target_path string yes Absolute target path. Must end in .md, must live under one of allowed_roots, no ‘..’ segments.
allowed_roots string[] yes Absolute directories the export may write into. REQUIRED — the caller declares intent; the tool never guesses a default. Empty list is refused.
overwrite boolean no If true, replace an existing file at target_path. Default false; existing files refuse the export so re-runs never clobber hand-edits.
extra_artifact_dirs string[] no Extra read-only search dirs for locating the source artifact (same as artifact_read).

The JSON Schema below is generated from the same zod schema the server validates against at the wire — it cannot drift from runtime behavior.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"pack": {
"type": "string",
"enum": [
"incident_pack",
"repo_pack",
"change_pack"
],
"description": "Pack identity of the source artifact."
},
"slug": {
"type": "string",
"minLength": 1,
"description": "Source artifact slug."
},
"target_path": {
"type": "string",
"minLength": 1,
"description": "Absolute target path. Must end in .md, must live under one of allowed_roots, no '..' segments."
},
"allowed_roots": {
"minItems": 1,
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"description": "Absolute directories the export may write into. REQUIRED — the caller declares intent; the tool never guesses a default. Empty list is refused."
},
"overwrite": {
"description": "If true, replace an existing file at target_path. Default false; existing files refuse the export so re-runs never clobber hand-edits.",
"type": "boolean"
},
"extra_artifact_dirs": {
"description": "Extra read-only search dirs for locating the source artifact (same as artifact_read).",
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
}
},
"required": [
"pack",
"slug",
"target_path",
"allowed_roots"
]
}

Every tool returns the standard envelope — tier_used, model, tokens_in/tokens_out, elapsed_ms, backend provenance, warnings. See Envelope & tiers.

Schema + handler: src/tools/artifactExportToPath.ts · registration: src/index.ts


Back to the Tool Reference.