Skip to main content
Glama

d8a_prepare_ai_context_change

Prepare an AI context change without saving it. mode is replace_instructions, add_fact, edit_fact (needs fact_id) or delete_fact (needs fact_id and lock_version, with an empty text). text is always the complete new text; for replace_instructions an empty string clears the instructions. Show the user the complete before and after text, including the full text of a fact being deleted, and the warnings, ask them to approve, then call d8a_execute_change. Other saved facts are kept.

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": {
      "property_id": "<property_id>",
      "mode": "<mode>",
      "text": "<text>"
    },
    "name": "d8a_prepare_ai_context_change"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYesreplace_instructions, add_fact, edit_fact or delete_fact.
textYesThe complete new text, not a patch. Empty clears instructions or deletes.
fact_idNoSaved fact to edit or delete, from d8a_get_ai_context.
property_idYesProperty ID.
lock_versionNoFrom d8a_get_ai_context; rejects the change if edited.

Output Schema

NameRequiredDescriptionDefault
reviewNo
targetYes
previewYes
expires_atNo
proposal_idNo
requires_acknowledgmentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations declare non-read-only, non-destructive, non-idempotent, and the description adds real context beyond that: nothing is persisted until execute, the response includes warnings, lock_version causes rejection if the fact was edited, and other saved facts are preserved. Minor gaps remain (expiry of a prepared change, permission requirements), but this is well above annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the non-persisting nature, then mode rules, then the approval workflow, in a dense passage with no filler sentences. Every clause carries operational information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema available, the description need not explain return values, and it still covers the mutation workflow, mode-specific preconditions, concurrency, and user-approval expectations. Nothing an agent needs to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Even with 100% schema coverage, the description adds cross-parameter constraints the schema does not encode: which modes require fact_id, that delete_fact needs both fact_id and lock_version with an empty text, and that text is always the complete replacement rather than a patch. It also explains the empty-string semantics for replace_instructions.

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 and resource ('Prepare an AI context change') and immediately scopes it as non-persisting ('without saving it'), which is exactly what separates it from the sibling d8a_execute_change. An agent can tell what this does and what it does not do without opening the schema.

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 an explicit operational sequence: show the user complete before/after text plus warnings, get approval, then call d8a_execute_change. That is strong when-to-use and next-step guidance, though it does not address when to prefer this over the other prepare_* siblings (goal, insight, property settings).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources