{
  "$id": "https://discern.sh/schema/v1/discern-mcp-tools.json",
  "format": 1,
  "x-discern-compatibility-policy": "mcp-tools-append-only",
  "tools": [
    {
      "name": "discern_status",
      "title": "Orient in the project",
      "description": "Start here: call discern_status. Read-only: reports the current project, Git, worktree, and fleet situation without running gates, tests, standards, or setup effects. The default structuredContent is a bounded orientation projection: data.projection names the mode and true omitted counts, while data.fleet_total preserves fleet size. Set verbose=true only when complete structured detail is genuinely needed. data.location distinguishes the main checkout from a worktree; data.git reports cleanliness and trunk divergence; data.gate lists checks that would run; data.gate_proof reports existing Proof state; data.worktree carries identity; and main checkout results sample data.fleet. Treat every other fleet row as a separate effort. data.queue lists the landing queue in order: each row an unlanded effort with its readiness and single waiting reason. data.git.trunk is the selected project's configured trunk. data.setup_unfinished carries pending markers, known-job applicability, and assurance counts. data.pending_tracked_refresh names tracked paths an ordinary discern_refresh would change; data.tracked_refresh_plan_errors names failures to derive that plan. incoming_overlap previews what discern_update brings in, and reappeared_worktree_paths need discern worktree prune in a shell. Owner decisions appear under Owner attention. Next action belongs to the reading agent. Set all=true to include the fleet from a worktree, or local=true to suppress it.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "all": {
            "description": "Include the fleet survey even from a worktree (default false).",
            "type": "boolean"
          },
          "local": {
            "description": "Local view only — suppress the fleet survey even in the main checkout (default false).",
            "type": "boolean"
          },
          "verbose": {
            "description": "Return complete structured status; the default is the bounded orientation projection.",
            "type": "boolean"
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_start",
      "title": "Start a worktree",
      "description": "Keep one worktree for an effort across review feedback and resumed sessions. If this effort already has one, continue at its recorded path; pass `path` to every discern tool. If unavailable, ask for its path instead of creating another. Do not call `discern_start` again. Create a fresh ISOLATED worktree — a separate checkout and branch for one effort — from the selected project's configured trunk. The result reports that trunk and data.path. Run this only from a main checkout when the effort has no worktree; it refuses from a linked worktree. The call sets up the checkout and re-aims later discern tools at it, but you must also move your own file operations to data.path. Pass an absolute path to start in another discern project. name seeds a normalized, readable worktree id; title and brief carry task metadata. from deliberately selects a non-trunk starting point. data.landing_authority reports any prospective standing grant, whose final coverage is rechecked against changed paths. Each non-preview call creates a new worktree and is not idempotent. Set dry_run to preview the plan without creating anything.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "name": {
            "description": "Optional task title and worktree-id seed. discern preserves the supplied text in data.task.title and normalizes the id. Omit for a random codename.",
            "type": "string"
          },
          "title": {
            "description": "Optional display title when it should differ from `name`. With no `name`, this title also seeds the worktree id.",
            "type": "string"
          },
          "brief": {
            "description": "Optional one-line task brief. The new worktree stores it for status, desk detail, and visible agent handoff.",
            "type": "string"
          },
          "from": {
            "description": "Branch the new worktree from a ref (branch, tag, or commit) or an unambiguous worktree id or path instead of the trunk. OMIT for everyday starts — the default is always the selected project's configured trunk, so there is nothing to look up or confirm. Use this only to build on unlanded or experimental work.",
            "type": "string"
          },
          "path": {
            "description": "Create the worktree for a specific discern project. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the project this MCP server currently targets. A successful start re-aims later discern calls at the new worktree.",
            "type": "string"
          },
          "dry_run": {
            "description": "Preview the start plan and touch nothing (default false).",
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false
      }
    },
    {
      "name": "discern_prepare",
      "title": "Run the fast gate",
      "description": "Run discern_prepare, the fast inner-loop gate — the project's quick quality check — with the fix-stage fixers, then the [generated] artifact regenerations, then the read-only check-stage jobs (no build jobs, no tests) — and return the result envelope. The quick check to run while iterating, before the full discern_done — and the pass to run before the FINAL commit, so the fixers and regenerations have nothing left to rewrite when discern_done runs on the committed tree. NOTE: the fixers and regenerations MUTATE the working tree (e.g. a formatter rewrites files). It does not stage or commit your changes and requests no standard measurements.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false
      }
    },
    {
      "name": "discern_done",
      "title": "Run the final gate and record Proof",
      "description": "Run the final gate on a clean, committed tree. It runs the finishing steps and the configured lint, type-check, tests, standards, and scope stages; a successful ordinary run records Proof for the committed tip. While iterating, use discern_prepare or a diagnostic's reproduce_cmd. After the final commit, call discern_done directly. discern_test is a standalone diagnostic and publishes no reusable completion evidence, so running it first repeats the complete test stage. Finishing steps such as format may rewrite files. A scope is a named region of the repository with its own check. Return the structured result with per-step outcomes plus normalized diagnostics (tool, file/line when available, message, and the exact command to reproduce each failure). A green run over a clean committed tree ahead of the selected project's configured trunk — its shared landing branch — also carries data.proof and resolves any recorded grant into data.landing_authority. Completion proves this worktree's committed tip; it does not land on the trunk. Follow the resolution-gated hints: an uncovered landing is reported to the owner in your own words and ends with data.proof.line verbatim before you wait; a covered landing names the verified source and routes straight to discern_accept. Never paste the full Proof page into a message; your owner retrieves it with `discern status --verbose`. Set dry_run to preview the plan without running anything.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "dry_run": {
            "description": "Preview the gate plan and touch nothing (default false).",
            "type": "boolean"
          },
          "ci": {
            "description": "Run the machine gate and report checkpoint questions without enforcing or recording review. The resulting Proof cannot be accepted.",
            "type": "boolean"
          },
          "rerun": {
            "description": "Run the full gate even when current green Proof covers this exact tree, or deliberately retry an unchanged red verdict. The rerun is recorded.",
            "type": "boolean"
          },
          "met": {
            "description": "Checkpoint ids whose served question your change satisfies — your recorded judgment, valid only for checkpoints with an active open question here (the awaiting_declaration refusal lists them). The gate runs in the same call once every awaiting checkpoint has a conclusion.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unmet": {
            "description": "Declare ONE served checkpoint's question not satisfied. The gate still runs; landing then needs the owner to authorize a variance for it.",
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The checkpoint id declared unmet."
              },
              "why": {
                "type": "string",
                "description": "The required rationale: one paragraph, 1-500 characters, no newlines or control characters. Recorded opaquely as Proof evidence for the owner's landing decision."
              }
            },
            "required": [
              "id",
              "why"
            ],
            "additionalProperties": false
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          },
          "policy_base": {
            "description": "Fetched policy base for a standalone CI report only.",
            "type": "string"
          },
          "standalone": {
            "description": "Run complete diagnostic feedback, including on a dirty tree. Results are transient and issue no Proof.",
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false
      }
    },
    {
      "name": "discern_update",
      "title": "Update this branch",
      "description": "Update this branch: merge the selected project's configured trunk into the selected worktree and run the complete refresh reconciliation. This is the inverse of discern_accept and resolves discern_done's behind-trunk check. Omit from for the configured trunk; pass from only to compose on a different ref or worktree. The operation is idempotent and never changes the main checkout. It requires a tracked-clean tree, aborts a conflicting merge without leaving conflict state, and remains the recovery after conflicts are resolved. Even when no merge is needed it reruns refresh and [worktree.setup].ensure; review and commit any tracked result. data.commits, data.files, data.overlap, data.scopes_incoming, and data.range report what arrived beneath this work. Capped lists carry their totals. Set dry_run to return the same predicted data without changing anything. Use discern_refresh for refresh alone and `discern upgrade` to update discern itself.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "from": {
            "description": "Pull a ref (branch, tag, or commit) or an unambiguous worktree id or path into this worktree instead of the trunk. OMIT for the routine call — the default is always the selected project's configured trunk, so there is nothing to check first. Use this only to compose on unlanded work.",
            "type": "string"
          },
          "dry_run": {
            "description": "Preview the update plan and touch nothing (default false).",
            "type": "boolean"
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true
      }
    },
    {
      "name": "discern_await",
      "title": "Await a fleet condition",
      "description": "Use this when your work depends on another task or new changes on the trunk. Wait in one blocking call instead of repeatedly polling status or asking the owner for updates. This tool does not run checks or land changes.\n\nPass one condition: `green` waits for the target's `discern_done` gate to pass with valid Proof for its current checkout, or for its work to land on the trunk; `landed` waits for the branch's latest changes to land on the trunk; `trunk_moved` waits for the trunk to change from where this watch started.\n\nOmit `timeout` for the longest supported wait: up to 3300s when the client supports long calls, or 45s when its limit is short or unknown. The call returns as soon as the condition holds. Larger requests are shortened to the supported duration and recorded in `data.requested_timeout_s`.\n\nIf the wait times out, `ok` stays true and `data.met` is false. The returned `data.resume` (`C1-…`) preserves the original watch so changes between calls are not missed.\n\nDo not surface progress updates until it returns. On `data.met: false`, continue with `data.resume` without surfacing an update; repeat without a fixed limit until met, stopped, or unnecessary. Never resume `ok: false`; follow its recovery hint. Report only when the condition holds, the watch is unnecessary, or errors need action. Always respond to new user input.\n\nIf a call is lost, use its progress handle (`R1-…`) with `discern_progress` to read the target, elapsed wait, and latest observation. Do not start another watch while the original is running. The progress handle only reads; `data.resume` continues the watch.\n\nWhen the condition holds, follow the returned `discern_start` or `discern_update` hint to bring the changes into your task.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "green": {
            "description": "Sibling selected by worktree id, path, local branch, or full local ref. Its checkout must hold an honored gate Proof; its landing also satisfies the wait.",
            "type": "string"
          },
          "landed": {
            "description": "Sibling selected by worktree id, path, local branch, or full local ref. Its work must become reachable from the trunk. The latest observed tip and landing transition survive branch deletion.",
            "type": "string"
          },
          "trunk_moved": {
            "description": "Wait until the trunk ref moves from its position at call start.",
            "type": "boolean"
          },
          "resume": {
            "description": "Short continuation handle returned by a previous not-met wait. Pass it by itself instead of `green`, `landed`, or `trunk_moved` so the original branch transition or trunk baseline survives between calls.",
            "type": "string"
          },
          "timeout": {
            "description": "Seconds before answering \"not yet\". Omit for the longest reliable bound this MCP client supports; a larger request is sliced without loss and 0 checks once.",
            "type": "number"
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_accept",
      "title": "Accept or queue the worktree",
      "description": "By default, submit the proven commit and start landing on the selected project's configured trunk under explicit owner consent or machine-verified authority. Without either, the call records the submission and returns awaiting consent. With action: queue, record the current clean, proven revision and return without checks or landing. Queueing reuses recorded authority, grants no permission and schedules nothing; an active walk may pick it up immediately. Ordinary accept with target starts a walk: the selected submission first, then other authorized submissions in queue order, stopping at refusal. data.landings records each attempt. A trunk that moved after the Proof is composed and re-proven in a disposable integration worktree; conflicts or failed checks land nothing. A served integration question retains that composition: answer with met or unmet and its composition receipt. Landing records the Proof note and removes the worktree, branch and resources when no later work remains. A second accept waits its turn. Recorded grants never cover a checkpoint variance or standard proposal. Use dry_run to preview the selected mode. After landing, report the effects and unresolved cleanup, ending with data.proof_line verbatim. The full review page remains available through `discern status --verbose`. Use action: emergency with reason for an explicit exception. prepare with met records served judgments; preparation_receipt carries its receipt. Review the failed, unrun and stale obligations, then pass the owner's exact approval_token with confirmed. No grant covers this exception and no passing Proof is issued. recover reconciles an interrupted emergency landing. No mode pushes.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "target": {
            "description": "Select the effort by id, path, or branch, from any checkout. Queue mode records its current proven revision; ordinary acceptance starts landing under applicable authority.",
            "type": "string"
          },
          "action": {
            "description": "Omit to submit and start landing. Select queue to record the current proven revision and return without starting checks or landing; it reuses recorded authority and starts no background run. Select emergency only for an explicit exception with fresh exact owner approval; ordinary grants do not cover it.",
            "type": "string",
            "enum": [
              "emergency",
              "queue"
            ]
          },
          "reason": {
            "description": "Emergency reason presented in the exact owner review.",
            "type": "string"
          },
          "prepare": {
            "description": "Emergency only: run checkpoint triggers, serve or record agent judgments, and retain exact review evidence. Runs no validation jobs or integration.",
            "type": "boolean"
          },
          "preparation_receipt": {
            "description": "Emergency preparation receipt for this exact repair and trunk; it conveys no owner approval.",
            "type": "string"
          },
          "met": {
            "description": "Satisfied served checkpoint questions (repeatable): the continuation of a landing whose combined result awaits your judgment, or emergency preparation with prepare: true. Refused when nothing served a question.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unmet": {
            "description": "Declare ONE served integration checkpoint question not satisfied. The retained composition is still proved; landing then needs the owner's variance decision.",
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The served checkpoint id declared unmet."
              },
              "why": {
                "type": "string",
                "description": "The required rationale: one paragraph, 1-500 characters."
              }
            },
            "required": [
              "id",
              "why"
            ],
            "additionalProperties": false
          },
          "composition_receipt": {
            "description": "The served composition receipt an answer or resumed variance decision binds to; the judgment refusal serves it (also in data.integration_judgment.composition). A replaced composition refuses the receipt and re-serves its own question.",
            "type": "string"
          },
          "approval_token": {
            "description": "The owner's currently approved emergency preview token. Requires confirmed; changed subjects need a new review.",
            "type": "string"
          },
          "recover": {
            "description": "Emergency landing id to reconcile without a new transition or new approval.",
            "type": "string"
          },
          "dry_run": {
            "description": "Preview the landing plan and the queue; touch nothing (default false).",
            "type": "boolean"
          },
          "confirmed": {
            "description": "Attestation that the owner has approved this landing in the current conversation. Set it only then. Recorded standing and effort grants are checked directly; do not assert them through this flag.",
            "type": "boolean"
          },
          "variance": {
            "description": "The owner's authorization to land each named declared-unmet checkpoint without changing it (requires confirmed). The ids must equal the current declared-unmet set, id for id — the awaiting_variance refusal serves it with each question and rationale — and recorded grants never authorize a variance.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "approve_standard": {
            "description": "The owner's exact approval tokens for the standard limit proposals carried by the current Proof (requires confirmed). Use the tokens served by the read-only refusal; they bind each standard, value, and reason. Generic or recorded landing grants never authorize them.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true
      }
    },
    {
      "name": "discern_map",
      "title": "Read the project map",
      "description": "Read or search the configured project map, the agent-maintained source for documented project behavior. With no input, return its full index and top-level regions digest with file-linked freshness facts. Pass `target` to read one page or list one region. Pass `search` to get the full match count and up to five highest-ranked results with context and canonical targets; combine it with `target` to scope the search. This local project surface is distinct from discern_docs, which reads discern's product manual. `path` selects the project or worktree to inspect; it never selects a map subtree.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "target": {
            "description": "An exact document or top-level region target. Without `search`, a document returns its Markdown and a region returns its compact index. With `search`, it limits the search to that document or region.",
            "type": "string"
          },
          "search": {
            "description": "Task language, a command, a config key, or error text to find in the map. Complete matches lead, and strong partial matches can fill the five result slots. Each result identifies its match kind and carries a canonical target. The query is used for this call and is not recorded in discern's logbook.",
            "type": "string"
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_progress",
      "title": "Read a long operation back",
      "description": "Read a long operation's current state or retained result, read-only. Active waits remain visible alongside independent checks: report what is waiting, elapsed time, the latest observed capacity use and configured limit when available, and whether resumption is automatic. A live process alone does not establish advancing work. Every discern_done, discern_test, discern_standards, discern_accept, and discern_await call announces a progress handle (`R1-…`) as its first progress fact and records the same facts in a journal. Pass that handle to read the operation's phase, the counts and failures known so far, named timing boundaries, and the retained final result — nothing re-runs. With no handle, read the most recently started operation of the selected checkout; another checkout's operation is named with its handle and refused, never substituted. data.executor says whether a process with the recorded id is still alive; data.outcome is absent while the executor has not finished. Reading starts, repairs, and cancels nothing, and the journal carries no validation or landing authority. A wait's own resume continuation (`C1-…`, returned by discern_await) is what resumes the wait; this tool only reads.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "handle": {
            "description": "The progress handle the operation announced (`R1-XXXX-XXXX-XX`). Omit to read the selected checkout's most recently started operation.",
            "type": "string"
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_test",
      "title": "Run the standalone test stage",
      "description": "discern_test runs the complete test stage as a standalone diagnostic when that stage itself is the requested result. This run issues no Proof and publishes no reusable completion evidence. For normal completion, use discern_prepare while iterating, commit, then call discern_done directly; discern_done includes the same complete test stage, so the final gate needs no standalone test preflight. After a failure, iterate with each diagnostic's reproduce_cmd or a targeted project command. When no test command is configured, discern_test returns a trivial pass with a hint that says so.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false
      }
    },
    {
      "name": "discern_standards",
      "title": "Measure or propose standard limits",
      "description": "Select action: measure to measure configured standards, compare their limits, or pin measured improvements. names narrows measurement and pin candidates; omit names for every standard. A plain measurement requests fresh readings; pin may reuse applicable evidence, commits only tighter limits, and carries Proof forward. Non-preview measurement requires a clean worktree unless force is set; pin always requires one. discern_done already requires every configured standard. Select action: propose only after owner agreement and after every required preview, review, regeneration, edit, discern_prepare run, and ordinary commit. Pass every simultaneous breach once in proposals; discern measures the same clean final HEAD through the shared planner, applies all limits in one config-only commit, and binds the set to that commit. Each reason is technical justification only: never claim approval, consent, or landing authority. Keep each reason within 500 characters; aim below 400. Repeat the same complete batch to renew an unchanged descendant; a new batch refuses existing proposal state. A changed value or reason is a different decision: present the new value, delta, and reason to the owner and obtain fresh agreement before recording it. Proposal landing still requires exact approval at discern_accept. dry_run previews either action without effects.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "measure",
              "propose"
            ],
            "description": "Select measure for readings or pinning; select propose to record one atomic batch of owner-agreed breached limits."
          },
          "dry_run": {
            "description": "Preview the selected action and touch nothing; proposal preview measures nothing (default false).",
            "type": "boolean"
          },
          "force": {
            "description": "Override the clean-worktree guard while authoring or debugging standards; ignored with pin (default false).",
            "type": "boolean"
          },
          "pin": {
            "description": "Capture measured improvements, commit the limit change alone, and carry gate Proof forward. Reuses available same-commit values and measures missing selected values (default false).",
            "type": "boolean"
          },
          "names": {
            "description": "Measure action only: measure these standards and limit pin candidates to them (default: every standard).",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "proposals": {
            "description": "Propose action only: every simultaneously approved breach as one ordered array of unique standard names. The transaction measures one final HEAD and writes one config commit.",
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The exact configured standard name."
                },
                "reason": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Technical justification only, one visible secret-free paragraph with a hard 500-character maximum; aim below 400. Do not claim approval, consent, or landing authority."
                }
              },
              "required": [
                "name",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "required": [
          "action"
        ],
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false
      }
    },
    {
      "name": "discern_impact",
      "title": "Show change impact",
      "description": "Show this change's impact: list which configured scopes — named regions of the repository with their own checks — the current branch and working tree wake. This decides which extra checks the gate, the project's full quality check, runs.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_coupling",
      "title": "Show co-change coupling",
      "description": "Surface the files that historically change TOGETHER as a read-only advisory mined from git history, so a touched file's habitual sibling isn't forgotten. Three forms: with NO file it is DIFF-AWARE, reporting the files that co-change with your current change set but are MISSING from it (the primary surface); pass `file` to query ONE file's top co-change partners (its blast radius); pass `file` AND `with` to drill into the shared history of TWO files — the commits where both changed, with dates and subjects, to judge a coupling essential vs incidental. The partners (data.partners) and the shared commits (data.commits) carry their evidence in plain counts, and the human-readable finding rides in hints[]. You decide whether a strong coupling is an essential invariant to lock with a forcing-function, or incidental and ignorable. The list is not exhaustive.",
      "stability": "evolving",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "file": {
            "description": "Query ONE file's co-change partners (its blast radius). Omit for the diff-aware view: what co-changes with your current change set but is missing from it.",
            "type": "string"
          },
          "with": {
            "description": "A SECOND file to compare with `file`: returns their shared co-change history — the commits where BOTH changed (dates + subjects), plus each file's own commit count, to weigh a coupling as one decision or incidental. Requires `file`.",
            "type": "string"
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_patterns",
      "title": "Read the practice patterns",
      "description": "Read the project's local, metadata-only logbook and return advisory workflow findings without changing files, configuration, authority, or retry policy. Each data.findings member carries a plain summary, concrete observed evidence with the relevant counts and denominator, its exact subject and scope, structured evidence, any material limitations, and one next_step. data.investigations connects eligible findings with the same summary/observed distinction, a bounded evidence boundary, one diagnostic_action, and a falsifier; treat estimated values only as estimates, cohort findings as descriptive rather than comparative judgments, and adjacency as non-causal. data.detectors includes fired, quiet, and insufficient-evidence states; do not treat limited history as a clean bill. The default keeps a bounded set of findings; data.findings_total reports any omitted count and all: true returns the larger complete set. Trends compare only runs sharing recorded setup conditions and name excluded runs in their evidence. Active history is the default; logbook_file selects one sealed archive basename from `discern patterns archives` without changing the active recorder. stats: true adds practice Stats from the same local evidence. Findings never block the gate. Retry only after the named evidence or precondition changes.",
      "stability": "evolving",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "stats": {
            "description": "Also compute data.stats — practice stats: changes accepted and their scale, green gate streaks, start-to-accept cycle times, standards trends, agent cohorts, and breadth, as plain counts. For the owner's own use; nothing is compared to anyone else's numbers.",
            "type": "boolean"
          },
          "all": {
            "description": "Report every finding instead of each detector's strongest few. The result can be large on a long history; prefer the default bound unless the elided findings are the question.",
            "type": "boolean"
          },
          "logbook_file": {
            "description": "A sealed logbook archive basename from `discern patterns archives`. Paths, active month files, and non-archive names are rejected. Omit to read the active logbook.",
            "type": "string"
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_checkpoints",
      "title": "Read the checkpoint contract",
      "description": "Report the checkpoint contract for this effort, read-only. data.checkpoints lists each governing checkpoint: its question (the judgment the caller records at the gate), one-line trigger summary, mode (stop interlocks the gate; advise never blocks), a structural preview of whether the current change fires it, and this effort's open-question state — awaiting_declaration, declared_met, declared_unmet (variance_required marks a conclusion only the owner can authorize a variance for at landing), or reopened (a relevant change unbound the recorded conclusion; declare again). data.policy is the merge-base commit whose configuration governs — never the branch's own edits. Nothing runs and nothing is recorded: a configured when command is reported as undecided (when_pending), and conclusions are recorded only by discern_done (met / unmet with why). Follow hints[] for the valid next step.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_refresh",
      "title": "Refresh generated artifacts",
      "description": "Refresh the agent files, materialized skills, provider integration artifacts, and the maintained ADR index (the record lists between markers in the map's ADR README, regenerated from the record files on disk). It rewrites discern-generated or shared artifacts only; edit instruction sources, skill sources, or explicit provider config for durable changes. Idempotent: a second call with the same inputs writes nothing. Set dry_run to preview every target and change nothing. Use discern_update for this branch; use `discern upgrade` for discern itself.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "dry_run": {
            "description": "Preview every refresh create, update, and removal without changing project or Git state (default false).",
            "type": "boolean"
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_docs",
      "title": "Read discern's manual",
      "description": "Read or search discern's complete published product manual. With no input, return every page's canonical target, stable identity, kind, title, and summary. Pass `target` to retrieve one page's exact reader-visible Markdown or list one region. Pass `search` to get the full match count and up to five highest-ranked results with context and canonical targets; combine it with `target` to scope the search. This manual is distinct from discern_map, which reads the current project's map. Decision records and protected map tiers are excluded.",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "target": {
            "description": "An exact document or top-level region target. Without `search`, a document returns its Markdown and a region returns its compact index. With `search`, it limits the search to that document or region.",
            "type": "string"
          },
          "search": {
            "description": "Task language, a command, a config key, or error text to find in discern's public docs. Complete matches lead, and strong partial matches can fill the five result slots. Each result identifies its match kind and carries a canonical target. The query is used for this call and is not recorded in discern's logbook.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_doctor",
      "title": "Check the install",
      "description": "Verify the discern install and return each check as an actionable result: config validity, schema currency, whether the declared job commands — configured project commands such as format, lint, and test — resolve on PATH, producer coverage and evidence reuse under the gate.concurrent_test_runs cap, which producers standards share or duplicate and which are candidate-bound, completion-record readability and outstanding emergency validation, and advisories. data.checks lists every check with its detail and — on failure — the exact fix. Set verbose=true only when you need data.execution_model, which lists, per configurable verb, the ordered steps it runs — each marked project (your configured command) or discern (a built-in step), with its expectation — so you can see what runs when, and catch a real config mistake (e.g. a slow command in the fast inner loop).",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "verbose": {
            "description": "Include the complete per-verb execution model (default false). Routine orientation omits it to keep the result bounded.",
            "type": "boolean"
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    },
    {
      "name": "discern_improvement",
      "title": "Find the next improvement",
      "description": "Return the ranked next action for improving the project, plus the full health audit and open qualitative reviews behind it for agent and owner to evaluate together. data.next_action is the single highest-value improvement to make now; data.categories carries the deterministic findings and review material. A score of 100 means nothing objectively weak, not that the project is done. Pass a category to focus one area.",
      "stability": "evolving",
      "inputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "category": {
            "description": "Restrict to one area: gate, setup, instructions, map, worktrees, standards, checkpoints, skills.",
            "type": "string"
          },
          "min_score": {
            "description": "Mark the result failed (`isError`) when the overall score is below this floor.",
            "type": "number"
          },
          "path": {
            "description": "Run this call against a specific discern project or worktree. Pass an ABSOLUTE filesystem path inside the intended checkout, including another repository in a multi-repo workspace; discern resolves its project root. Omit it to use the checkout this MCP server currently targets. Use it when you cannot re-root into a worktree or are coordinating multiple repositories. The override applies to this call only; relative paths are rejected.",
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "annotations": {
        "readOnlyHint": true,
        "idempotentHint": true,
        "openWorldHint": false
      }
    }
  ],
  "resources": [
    {
      "name": "discern-status",
      "kind": "resource",
      "uri": "discern://status"
    },
    {
      "name": "discern-impact",
      "kind": "resource",
      "uri": "discern://impact"
    },
    {
      "name": "discern-config",
      "kind": "resource",
      "uri": "discern://config"
    },
    {
      "name": "discern-map-index",
      "kind": "resource",
      "uri": "discern://map"
    },
    {
      "name": "discern-map-doc",
      "kind": "template",
      "uri": "discern://map/{+target}"
    },
    {
      "name": "discern-docs-index",
      "kind": "resource",
      "uri": "discern://docs"
    },
    {
      "name": "discern-docs-doc",
      "kind": "template",
      "uri": "discern://docs/{+target}"
    }
  ]
}
