Manage Gnosari Instructions
gnosari_manage_instructionsUpdate an agent's system instructions.
Prefer action="edit" with anchored edits for any change to
existing text: only the changed span is sent, everything else stays
byte-identical, and the response's applied[].excerpt shows what
landed so no second read is needed. Use replace only to write a
whole new instruction set, append/prepend to add at either end.
The usual flow is gnosari_create → gnosari_get (read
instructions_version) → this tool with expected_version set;
every response returns the new instructions_version for the next
call. The agent's behavior is defined entirely by its instructions, so
craft them carefully.
Raises:
ValueError: VALIDATION_ERROR for a malformed call, ANCHOR_NOT_FOUND
or ANCHOR_AMBIGUOUS for an unusable anchor, CONFLICT for a stale
expected_version, or a wizard-guardrail rejection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | No | Anchored partial edits for action 'edit' — prefer this over 'content' for any change to existing text. Each edit is {op, old, new}, where op is replace/insert_before/insert_after/delete/append/prepend. 'old' is matched exactly, whitespace-significant, and must occur exactly once unless replace_all=True — if it is ambiguous, widen it with surrounding lines. Edits apply in order, all-or-nothing: any failing edit writes nothing and names its index. Never re-send the whole text to change part of it. Maximum 20 per call | |
| action | Yes | How to apply the change: 'edit' applies anchored partial edits (prefer it for any change to existing text), 'replace' overwrites everything, 'append' adds to the end, 'prepend' adds to the beginning | |
| content | No | Whole-text payload for action 'replace', 'append' or 'prepend'. Never combine with 'edits'. To CLEAR instructions call gnosari_update(clear_fields=["instructions"]) — an empty string is refused | |
| gnosari_id | Yes | ID of the agent to update | |
| confirm_replace | No | Deliberate-overwrite flag. Required when action='replace' would discard more than 2000 stored characters; ignored otherwise | |
| expected_version | No | The instructions_version from your last gnosari_get (or from the previous write's response). Strongly recommended with 'edits': if the stored text changed underneath you the call is refused with CONFLICT and nothing is written |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| applied | No | One entry per anchored edit, in submitted order, each with an excerpt of the change — verify the write from these instead of re-reading. Empty for action='replace', which is not anchored | |
| preview | Yes | First 200 characters of the instructions | |
| readiness | Yes | Configuration completeness with machine-readable missing keys and prioritized next steps | |
| gnosari_id | Yes | Agent ID | |
| action_performed | Yes | What was done: 'replace', 'append', 'prepend', or 'edit' | |
| instructions_length | Yes | Character count of the instructions after the operation | |
| instructions_version | Yes | Content hash of the stored instructions AFTER this write. Pass it as the next call's expected_version to guarantee nobody changed the text underneath you |