diff --git a/server/app/mcp_server.py b/server/app/mcp_server.py index ca20f45..d0abdef 100644 --- a/server/app/mcp_server.py +++ b/server/app/mcp_server.py @@ -49,6 +49,12 @@ 4. Use commit_changes with a short factual summary. 5. For simple full-document replacements, update_doc may create, apply, validate, and commit in one call. +Inventory creation workflow (critical): +- Some inventory schemas (e.g., hosts) require a `docs` field linking to a Markdown file. +- Before creating an inventory item with a `docs` reference, use propose_doc_change to create the target Markdown document first, then apply_pending_change to apply it. +- Only after the document exists should you propose the inventory item with the `docs` path. +- Never use local filesystem tools to edit gnexus-book repository files directly — always use the MCP tools. + For propose_inventory_item_change, pass concrete top-level arguments, not a wrapper: inventory_type="hosts", item_id="bserv", mode="create", patch={"ip_address": "192.168.1.130", "user": "bserv"}, summary="Document bserv host". The patch object is the inventory item fields to create or update. @@ -98,6 +104,10 @@ 4. Use commit_changes with a concise factual summary. 5. Use update_doc only for simple full-document updates. +Inventory creation rule: +- When an inventory item requires a `docs` field, create the Markdown document first via propose_doc_change + apply_pending_change, then propose the inventory item. +- Never edit gnexus-book files directly through filesystem or terminal — always go through MCP tools. + Inventory write call shape: - propose_inventory_item_change(inventory_type, item_id, patch, summary, reason?, mode?) - Do not wrap arguments in params.