{
  "isError" : false,
  "request" : {
    "tool" : "edit file",
    "verbosity" : "summary"
  },
  "response" : {
    "match" : "exact",
    "meta" : {
      "serverMs" : "<timing>"
    },
    "note" : "Resolved 'edit file' -> 'ek9_edit_file'",
    "status" : "ok",
    "tool" : {
      "description" : "Answers first: status (applied | ready | would-fail | conflicts), written, edits[{file, startLine, endLine, before, after}], wouldBeDiagnostics from the verifying compile and contentHash on an applied edit - an atomic batch of text edits to one file, or to several as one apply.",
      "examples" : [ "{path:'orders/constants.ek9', edits:[{mode:'find-replace', find:'MAX_RETRIES <- 5', replace:'MAX_RETRIES <- 10'}], dryRun:true} → status:ready (default expectedOccurrences=1 verifies exactly one match).", "{path:'notes.md', edits:[{mode:'regex-replace', pattern:'// TODO\\\\(.*?\\\\): ', replace:'// TODO: ', expectedOccurrences:'all'}]} → status:applied with a non-ek9-file-not-compile-checked advisory." ],
      "name" : "ek9_edit_file",
      "parameters" : [ {
        "name" : "dirtyOverlay",
        "required" : false,
        "type" : "array"
      }, {
        "name" : "dryRun",
        "required" : false,
        "type" : "boolean"
      }, {
        "name" : "edits",
        "required" : false,
        "type" : "array"
      }, {
        "name" : "expectedContentHash",
        "required" : false,
        "type" : "string"
      }, {
        "name" : "expectedWorkspaceHash",
        "required" : false,
        "type" : "string"
      }, {
        "name" : "files",
        "required" : false,
        "type" : "array"
      }, {
        "name" : "path",
        "required" : false,
        "type" : "string"
      }, {
        "name" : "showExamples",
        "required" : false,
        "type" : "boolean"
      }, {
        "name" : "terse",
        "required" : false,
        "type" : "boolean"
      }, {
        "name" : "terseErrors",
        "required" : false,
        "type" : "boolean"
      }, {
        "enum" : [ "full", "summary", "none" ],
        "name" : "verbosity",
        "required" : false,
        "type" : "string"
      } ],
      "whenNotToUse" : [ "You hold the FULL content of the file (a new file, or an editor tool returned modifiedSource) - use ek9_write_file.", "Renaming an EK9 identifier (class/method/field/local) — use ek9_rename_symbol; it rewrites the workspace-wide reference graph, this tool is text-only and single-file.", "Structural EK9 edits (changing a signature, adding a method, extracting a variable) — use the semantic editor (ek9_change_signature, ek9_add_method, ek9_extract_variable, …); it understands EK9 grammar, this tool does not.", "Removing the whole file — use ek9_delete_file." ],
      "whenToUse" : "You want a few exact text changes in an EXISTING file - one call with path + edits:[{mode:'find-replace', find:'old', replace:'new'}]. The line-replace and regex-replace modes mix freely in the same atomic batch, and files:[{path, edits}] lands several files as one apply. Cheaper than ek9_write_file for small surgical changes; untouched bytes are preserved exactly."
    }
  },
  "scenario" : "normalised_phrase_summary_shape",
  "tool" : "query_tool_detail"
}
