Set Metadata

Attach or update metadata on a Note or Collection

bdambrosio 63de697 2 files · 2.0 KB Updated

File contents

Set-Metadata

INPUT CONTRACT

  • target (required): $variable, Note/Collection ID, or name
  • value (required): Metadata text (string, may be JSON)
  • out (optional): $variable — bound to the metadata Note ID

REQUIREMENTS:

  • Target resource must exist
  • Value must be provided

BEHAVIOR

Associates a metadata text string with the target Note or Collection. Idempotent: updates existing metadata if already present. If out is provided, the variable is bound to the metadata Note ID.

EXAMPLES

{"type": "set-metadata", "target": "$report", "value": "{\"source\": \"weather.gov\", \"retrieved\": \"2026-02-21\"}"}
{"type": "set-metadata", "target": "$report", "value": "$meta_text", "out": "$meta_note"}

OUTPUT

Returns success with the metadata Note ID.

FAILURE SEMANTICS

  • Target resource not found
  • Missing target or value parameter

bdambrosio/cognitive_workbench/tree/main/src/primitives/set-metadata commit 63de6972bf

Frequently asked questions

npx skillmds@latest add bdambrosio/set-metadata