@brightbeamai/chap-coordinator-mcp 0.2.13 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -147,8 +147,8 @@ var SCHEMAS = {
147
147
  task_id: TASK_ID,
148
148
  state: {
149
149
  type: "string",
150
- enum: ["in_progress", "review_requested", "declined", "paused", "cancelled", "completed"],
151
- description: "The state to move the task to. Only the transitions in SPECIFICATION.md 8.1 are legal from the task's current state; others are refused with -32602. A task marked review_required cannot be moved to 'completed' here: submit the output with chap.task.complete, which opens the review."
150
+ enum: ["in_progress", "declined", "cancelled", "completed"],
151
+ description: "The state to move the task to. Only the transitions in SPECIFICATION.md 8.1 are legal from the task's current state; others are refused with -32602. A review opens with chap.review.request, or with chap.task.complete on a task that requires one, so 'review_requested' is not a target here. A task marked review_required cannot be moved to 'completed' here: submit the output with chap.task.complete, which opens the review."
152
152
  },
153
153
  progress_note: { type: "string", description: "Short note on what changed, kept in the task's history." }
154
154
  },
@@ -184,7 +184,12 @@ var SCHEMAS = {
184
184
  properties: {
185
185
  method: { type: "string", description: "Return only entries for this CHAP method, e.g. 'decide.override'. Matched in full, without the 'chap.' tool-name prefix." },
186
186
  from: { type: "string", description: "Return only entries whose actor is this participant URI." },
187
- task_id: { type: "string", description: "Return only entries about this task." }
187
+ task_id: { type: "string", description: "Return only entries about this task." },
188
+ outcome: {
189
+ type: "string",
190
+ enum: ["accepted", "refused"],
191
+ description: "Return only accepted calls, or only the refused attempts the coordinator recorded. Omit for both."
192
+ }
188
193
  }
189
194
  }
190
195
  },
@@ -304,8 +309,9 @@ var SCHEMAS = {
304
309
  description: "The successor task to open for the escalation target.",
305
310
  properties: {
306
311
  kind: { type: "string", description: "Task kind for the successor. Defaults to the original's kind." },
307
- assignee: { ...PARTICIPANT_URI, description: "Who the escalation goes to. Must be a workspace member." },
308
- input: { type: "object", additionalProperties: true, description: "Input payload for the successor. It defaults to an empty object rather than the original's input, so anything the new assignee needs has to be restated here." }
312
+ assignee: { ...PARTICIPANT_URI, description: "Who the escalation goes to. Must be a workspace member who is not paused: a paused assignee is refused with -32063." },
313
+ input: { type: "object", additionalProperties: true, description: "Input payload for the successor. It defaults to an empty object rather than the original's input, so anything the new assignee needs has to be restated here." },
314
+ mode: { type: "string", enum: ["shadow", "trial", "production"], description: "Mode for the successor, defaulting to the original's. A mode above the workspace's current ceiling is refused with -32040, so after the ceiling is lowered a task is escalated by naming a mode within it." }
309
315
  },
310
316
  required: ["assignee"]
311
317
  }
@@ -496,7 +502,7 @@ var SCHEMAS = {
496
502
  type: "string",
497
503
  enum: ["task", "participant", "workspace"],
498
504
  default: "task",
499
- description: "What the resume applies to. 'task' returns a paused task to 'in_progress'; a task that is not paused is refused with -32061. 'participant' allows that member to be assigned tasks again. 'workspace' returns the workspace to active."
505
+ description: "What the resume applies to. 'task' returns a paused task to the state it held at the pause; a task that is not paused is refused with -32061. 'participant' allows that member to be assigned tasks again. 'workspace' returns the workspace to active."
500
506
  },
501
507
  task_id: TASK_ID,
502
508
  participant_uri: { ...PARTICIPANT_URI, description: "Whose work to resume, when scope is 'participant'. Must be a workspace member." }
@@ -545,8 +551,10 @@ var SCHEMAS = {
545
551
  description: "The replacement task.",
546
552
  properties: {
547
553
  kind: { type: "string", description: "Task kind for the successor. Required." },
548
- assignee: { ...PARTICIPANT_URI, description: "Who takes the replacement on. Defaults to the superseded task's assignee, and must be a workspace member." },
549
- input: { type: "object", additionalProperties: true, description: "Input payload for the successor. Defaults to an empty object." }
554
+ assignee: { ...PARTICIPANT_URI, description: "Who takes the replacement on. Defaults to the superseded task's assignee, and must be a workspace member who is not paused." },
555
+ input: { type: "object", additionalProperties: true, description: "Input payload for the successor. Defaults to an empty object." },
556
+ mode: { type: "string", enum: ["shadow", "trial", "production"], description: "Mode for the successor, defaulting to the superseded task's. A mode above the workspace's current ceiling is refused with -32040." },
557
+ review_required: { type: "boolean", description: "Whether completing the successor needs a reviewer decision. A successor of a task that requires review requires it whatever is passed here, and under modes/1.0 so does a trial-mode successor." }
550
558
  },
551
559
  required: ["kind"]
552
560
  },
@@ -577,7 +585,7 @@ var SCHEMAS = {
577
585
  workspace: WORKSPACE_ID,
578
586
  from: PARTICIPANT_URI,
579
587
  task_id: TASK_ID,
580
- candidates: { type: "array", items: PARTICIPANT_URI, description: "Candidate assignees. An empty list is refused with -32513. Candidates that are not workspace members are dropped, and if none remain the call is refused with -32510. The default policy selects the first remaining candidate; an operator-supplied routing policy may select on any basis." }
588
+ candidates: { type: "array", items: PARTICIPANT_URI, description: "Candidate assignees. An empty list is refused with -32513. The default policy takes the first candidate that is a workspace member and is not paused, and refuses the call with -32510 when there is none. An operator-supplied routing policy may select on any basis; a choice that is not a member is refused with -32510, and one who is paused with -32063." }
581
589
  },
582
590
  required: ["workspace", "from", "task_id", "candidates"]
583
591
  },
@@ -714,52 +722,147 @@ var TOOL_DESCRIPTIONS = {
714
722
  // Core
715
723
  "chap.workspace.create": "Create a workspace: the container for the participants, tasks and audit log of one piece of collaborative work. Returns the workspace id, which every later call carries.",
716
724
  "chap.workspace.describe": "Report the current state of a workspace: its members, enabled profiles, audit length, and task and override counts.",
717
- "chap.workspace.set_profiles": "Replace the set of profiles enabled on a workspace. Enabling audit-scitt/1.0 on a workspace that already has entries leaves those entries outside the hash chain.",
725
+ "chap.workspace.set_profiles": "Replace the whole set of profiles enabled on a workspace. The list is not merged: any profile absent from it is dropped, so send the complete set you want. Enabling audit-scitt/1.0 on a workspace that already has entries starts the chain from that point and leaves the earlier entries permanently outside it, which chap.audit.verify_chain then reports as not_evaluated. Prefer setting profiles at chap.workspace.create, where no entries exist yet to strand.",
718
726
  "chap.participant.join": "Add a participant to a workspace. The type given, human, agent, service, group or workspace, decides whether they are eligible to review work that requires it.",
719
- "chap.participant.leave": "Remove a participant from a workspace. Entries they have already written stay in the audit log.",
720
- "chap.task.create": "Create a task: a unit of work assigned to one participant. Set review_required to make the task's completion depend on a reviewer decision rather than on the assignee.",
727
+ "chap.participant.leave": "Remove a participant from a workspace. Entries they have already written stay in the audit log and their past signatures still verify, so leaving is not a way to withdraw a decision. They can no longer be assigned tasks or act as a reviewer, and returning means a fresh chap.participant.join.",
728
+ "chap.task.create": "Create a task: a unit of work assigned to one participant. Set review_required to make completion depend on a reviewer decision rather than on the assignee. Returns a task_id that the rest of the lifecycle takes. Supplying idempotency_key is what makes a retry safe: a repeat carrying a key already seen returns the original task, while a repeat without one creates a second task. Assigning to a paused member is refused.",
721
729
  "chap.task.update": "Move a task to a new state. Only the transitions in the specification's lifecycle table are accepted, and a task that requires review cannot be completed here.",
722
730
  "chap.task.complete": "Submit a task's output. A task that requires review does not complete: the output is held as the artefact under review, the task moves to review_requested, and a reviewer decision completes it. Any other task completes immediately.",
723
- "chap.audit.read": "Read entries from a workspace's audit log, optionally within a sequence range and filtered by method, sender or task.",
731
+ "chap.audit.read": "Read entries from a workspace's audit log, optionally within a sequence range and filtered by method, sender, task or outcome. This is the query surface for everything the workspace has recorded, decisions and overrides included. An accepted call is under 'envelope'. A refused attempt the coordinator recorded, such as a decision by someone the review was not addressed to, is under 'request' with an 'outcome' giving the error code, and it did not take effect. Reads only: it records nothing, so it never appears in its own output. Entries come back as recorded, without aggregation, so grouping them, by tag for instance, is the reader's job.",
724
732
  // review/1.0
725
733
  "chap.review.request": "Open a review on a task and address it to one or more reviewers. They then call chap.decide.approve, chap.decide.reject, chap.decide.override or chap.abstain.declare. Repeating the request with the same artefact adds reviewers to the open review.",
726
- "chap.decide.approve": "Approve the artefact under review. The task completes once the review's rule is satisfied.",
727
- "chap.decide.reject": "Reject the artefact under review. The task is declined, or returns to in_progress if request_revision is set.",
734
+ "chap.decide.approve": "Approve the artefact under review as it stands. Only a reviewer the review was addressed to may decide, and anyone else is refused with -32011. The task completes once the review's rule is satisfied, so under all_approve or quorum:N an approval may leave the review open awaiting others. Use chap.decide.override instead to accept a corrected version.",
735
+ "chap.decide.reject": "Reject the artefact under review. The task is declined, or returns to in_progress when request_revision is set, which is the choice between ending the work and sending it back. Only a reviewer the review was addressed to may decide. Use chap.decide.override instead to correct the artefact and accept it rather than refuse it.",
728
736
  "chap.decide.override": "Correct the artefact under review with an RFC 6902 JSON Patch and accept the result. The patch, the rationale and any tags are recorded together, so the audit log holds what was changed and why, rather than only that the work was not accepted as written.",
729
- "chap.abstain.declare": "Stand aside from a review, giving a reason and a category. The task moves to abstained.",
730
- "chap.escalate.raise": "Hand a task upwards. The original moves to escalated and is linked to a new task opened for whoever takes it on. The successor starts with an empty input unless one is supplied.",
737
+ "chap.abstain.declare": "Stand aside from a review this participant cannot decide, for example on a conflict of interest or for want of context. Use it in place of chap.decide.reject, which judges the work; abstaining judges nothing and leaves the artefact intact. It requires an open review addressed to the caller and answers -32010 otherwise. The task moves to abstained, which is not terminal: chap.escalate.raise or a fresh chap.review.request can still carry it forward.",
738
+ "chap.escalate.raise": "Hand a task upwards, where the current holder can act but should not decide alone. The original moves to escalated and is linked to a new task for whoever takes it on. Use chap.handoff.propose to pass work sideways without that link, and chap.control.supersede to replace a task outright. The successor starts with an empty input unless one is supplied, so restate whatever the new assignee needs. A completed, cancelled or superseded task cannot be escalated. The successor takes the mode new_task.mode names, or else the original's, and requires review when the original did, or when it is a trial task under modes/1.0. A paused assignee is refused with -32063, and a mode above the workspace's current ceiling with -32040; after the ceiling is lowered, name a mode within it.",
731
739
  // whisper/1.0
732
740
  "chap.whisper.ask": "Put one question to one or more participants, with a deadline and a default. If the deadline passes unanswered the default applies, so a task is never blocked waiting on a reply.",
733
- "chap.whisper.answer": "Answer an open whisper. Where the question carried options, the answer must name one of them.",
741
+ "chap.whisper.answer": "Answer an open whisper. Where the question carried options, the answer must name one of their ids and any other value is refused with -32022. A whisper already answered is refused with -32020 and one past its deadline with -32021, in which case the default supplied at chap.whisper.ask has already been applied.",
734
742
  // deliberation/1.0
735
- "chap.deliberate.open": "Open a deliberation among several participants under a stated voting rule: any_one_approves, all_approve, quorum:N, weighted_vote:T or weighted_vote_with_veto:T.",
736
- "chap.deliberate.comment": "Record a comment on an open deliberation, so the reasoning is on the audit log alongside the votes.",
737
- "chap.deliberate.vote": "Cast a yea, nay or abstain in an open deliberation. Each participant votes once.",
738
- "chap.deliberate.close": "Close a deliberation and compute its outcome from the votes cast under its rule.",
743
+ "chap.deliberate.open": "Open a group decision among several participants under a stated voting rule: any_one_approves, all_approve, quorum:N, weighted_vote:T or weighted_vote_with_veto:T. Use it where several people must weigh in on one question; chap.review.request is the tool for judging one participant's output. Returns a deliberation_id that the comment, vote and close tools all take. The participant list, rule, weights and veto map are fixed at open, so the terms are settled before anyone votes. No outcome exists until chap.deliberate.close computes one.",
744
+ "chap.deliberate.comment": "Record a comment on an open deliberation, so the reasoning behind a vote survives alongside the tally. Comments carry no weight in the outcome and may be added by any participant at any point before chap.deliberate.close.",
745
+ "chap.deliberate.vote": "Cast a yea, nay or abstain in an open deliberation. Each participant votes once and a second attempt answers -32031, so a vote cannot be revised. An abstention is recorded but counts as neither side, which under all_approve or quorum:N withholds the approval those rules need. The tally is computed later, by chap.deliberate.close.",
746
+ "chap.deliberate.close": "Close a deliberation and compute its outcome from the votes cast under its rule. Closing is final: further comments and votes are refused with -32032. Calling it again on a closed deliberation returns the same outcome and changes nothing, so a retry is safe. Votes never cast are simply absent from the tally rather than counted as abstentions.",
739
747
  // handoff/1.0
740
748
  "chap.handoff.propose": "Propose handing one or more tasks to another participant or a group, with the context needed to pick them up. Every task must currently be assigned to the proposer.",
741
- "chap.handoff.accept": "Accept a proposed handoff. The accepted tasks are reassigned to the accepting participant.",
742
- "chap.handoff.decline": "Decline a proposed handoff, with a reason and optionally a suggestion of who should take it instead.",
749
+ "chap.handoff.accept": "Accept a proposed handoff. The accepted tasks are reassigned to the accepting participant, which is the point at which responsibility actually moves. Omitting accepted_task_ids accepts all of them. Accepting resolves the proposal for good: a later accept or decline on the same handoff answers -32051. A paused participant cannot accept and is refused with -32063.",
750
+ "chap.handoff.decline": "Decline a proposed handoff. The tasks stay with the proposer and nothing is reassigned, which is the difference from chap.handoff.accept. Declining resolves the proposal for good: a later accept or decline on the same handoff answers -32051, and trying again means a fresh proposal. The reason is recorded so the proposer can route the work elsewhere.",
743
751
  // control/1.0
744
752
  "chap.control.pause": "Pause work. Scoped to a task it moves that task to paused; to a participant it stops new tasks being assigned to them; to the workspace it refuses every method except describing, reading the audit log, joining, leaving and resuming.",
745
- "chap.control.resume": "Resume work paused at the same scope: a task returns to in_progress, a participant can be assigned tasks again, a workspace returns to active.",
753
+ "chap.control.resume": "Resume work paused at the same scope: a task returns to the state it held at the pause, a participant can be assigned tasks again, a workspace returns to active.",
746
754
  "chap.control.cancel": "Cancel a task. Cancelled is terminal, and a task that has already settled cannot be cancelled.",
747
- "chap.control.snapshot": "Capture the workspace state as an artefact and return its id, which chap.control.rollback takes as its target.",
755
+ "chap.control.snapshot": "Capture the workspace state as an artefact before a change you may want to undo. Returns a snapshot artefact id, which is the only thing chap.control.rollback accepts as a target; the label is for a human reading the log and cannot be used to select it. Taking a snapshot changes nothing. Note that a rollback restores only the mode ceiling and member roles, so a snapshot is a narrow safety net rather than a general undo.",
748
756
  "chap.control.rollback": "Restore workspace state from a snapshot. The mode ceiling and member roles are restored; the rollback is appended to the audit log rather than rewriting it.",
749
- "chap.control.supersede": "Replace a task with a successor in one call. The original moves to superseded and stays linked to its replacement.",
757
+ "chap.control.supersede": "Replace a task with a successor in one call. The original moves to superseded and stays linked to its replacement. The successor requires review when the original did, whatever its own review_required says, and a paused assignee is refused with -32063.",
750
758
  "chap.control.set_mode_ceiling": "Set the highest operating mode tasks in this workspace may request. A task above the ceiling is refused.",
751
759
  // routing/1.0
752
- "chap.task.route": "Choose an assignee for a task from a list of candidates and record a route_decision artefact naming the policy, the candidate chosen, and the alternatives it passed over.",
760
+ "chap.task.route": "Choose an assignee for a task from a list of candidates and reassign the task to the one selected. Use it where the choice itself belongs on the record: it writes a route_decision artefact naming the policy, the candidate chosen and the alternatives passed over, none of which is captured by setting assignee directly on chap.task.create. The default policy takes the first candidate that is a workspace member and is not paused. An operator-supplied policy may choose on any basis, and the call is refused with -32510 when its choice is not a member, or with -32063 when its choice is paused.",
753
761
  "chap.review.depth": "Decide how much review a task warrants, skip, spot_check or full, from its routing hints. Records a route_decision artefact giving the rule that produced the answer.",
754
- "chap.escalate.auto": "Evaluate a task's routing hints against the escalation policy and report whether it should be escalated, and to whom. Records a route_decision artefact.",
762
+ "chap.escalate.auto": "Evaluate a task's routing hints against the escalation policy and report whether it should be escalated, and to whom. It decides only: a route_decision artefact is recorded but the task does not move, so act on the answer with chap.escalate.raise. The default policy escalates on criticality critical, or high with confidence below 0.6.",
755
763
  // security-signed/1.0
756
764
  "chap.participant.rotate_key": "Retire a participant's signing key and register its replacement. The old key stays in the key history with a valid_until timestamp, so envelopes it signed still verify.",
757
765
  "chap.participant.revoke_key": "Revoke a signing key, for example after a device is lost. Signatures presented with it are refused from then on. Revoking another participant's key requires the admin role.",
758
766
  // audit-scitt/1.0
759
767
  "chap.audit.submit_to_scitt": "Build COSE_Sign1-shaped statements for a range of audit entries and submit them to the configured SCITT transparency service. Where none is configured the statements are returned for submission out of band.",
760
- "chap.audit.verify_receipt": "Verify a SCITT receipt through the configured verifier. Verification fails closed where no verifier is configured.",
768
+ "chap.audit.verify_receipt": "Check a receipt returned by an external SCITT transparency service, confirming that service logged the statement. This is the external half of verification; chap.audit.verify_chain checks the local prev-hash chain instead, and the two answer different questions. Verification is delegated to a hook the deployment supplies and fails closed with -32082 when none is configured, so a missing verifier can never read as a pass. Reads only: nothing is recorded.",
761
769
  "chap.audit.verify_chain": "Replay a workspace's prev-hash chain. Only status verified with ok true means the log was checked and is intact. Status not_evaluated with ok false means part of the log was never checked, so its integrity is unknown and must not be reported as verified; entries_unchecked says how much. An error means the chain is broken or absent."
762
770
  };
771
+ var READ_ONLY = /* @__PURE__ */ new Set([
772
+ "chap.workspace.describe",
773
+ "chap.audit.read",
774
+ "chap.audit.verify_chain",
775
+ "chap.audit.verify_receipt",
776
+ // Submitting reads the chain and sends it onward. It changes nothing here,
777
+ // which is what readOnlyHint claims; openWorldHint carries the fact that it
778
+ // reaches a service outside this coordinator.
779
+ "chap.audit.submit_to_scitt"
780
+ ]);
781
+ var DESTRUCTIVE = /* @__PURE__ */ new Set([
782
+ "chap.workspace.set_profiles",
783
+ // replaces the profile set; can strand entries outside the chain
784
+ "chap.participant.leave",
785
+ // removes a member
786
+ "chap.participant.revoke_key",
787
+ // invalidates a key from then on
788
+ "chap.control.cancel",
789
+ // cancelled is terminal
790
+ "chap.control.supersede",
791
+ // superseded is terminal
792
+ "chap.control.rollback"
793
+ // overwrites the mode ceiling and member roles
794
+ ]);
795
+ var IDEMPOTENT = /* @__PURE__ */ new Set([
796
+ "chap.workspace.describe",
797
+ "chap.audit.read",
798
+ "chap.audit.verify_chain",
799
+ "chap.audit.verify_receipt",
800
+ "chap.participant.join",
801
+ // a re-join is additive and adds no duplicate member
802
+ "chap.participant.leave",
803
+ // leaving twice leaves the same absence
804
+ "chap.control.pause",
805
+ // pausing an already paused target changes nothing
806
+ "chap.control.set_mode_ceiling",
807
+ // setting the ceiling it already has changes nothing
808
+ "chap.deliberate.close"
809
+ // returns the same outcome, recomputing nothing
810
+ ]);
811
+ var OPEN_WORLD = /* @__PURE__ */ new Set([
812
+ "chap.audit.submit_to_scitt",
813
+ "chap.audit.verify_receipt"
814
+ ]);
815
+ var TITLES = {
816
+ "chap.workspace.create": "Create workspace",
817
+ "chap.workspace.describe": "Describe workspace",
818
+ "chap.workspace.set_profiles": "Replace workspace profiles",
819
+ "chap.participant.join": "Add participant",
820
+ "chap.participant.leave": "Remove participant",
821
+ "chap.task.create": "Create task",
822
+ "chap.task.update": "Change task state",
823
+ "chap.task.complete": "Submit task output",
824
+ "chap.audit.read": "Read audit log",
825
+ "chap.review.request": "Request review",
826
+ "chap.decide.approve": "Approve",
827
+ "chap.decide.reject": "Reject",
828
+ "chap.decide.override": "Override with a correction",
829
+ "chap.abstain.declare": "Abstain from review",
830
+ "chap.escalate.raise": "Escalate task",
831
+ "chap.whisper.ask": "Ask a whisper",
832
+ "chap.whisper.answer": "Answer a whisper",
833
+ "chap.deliberate.open": "Open deliberation",
834
+ "chap.deliberate.comment": "Comment on deliberation",
835
+ "chap.deliberate.vote": "Vote in deliberation",
836
+ "chap.deliberate.close": "Close deliberation",
837
+ "chap.handoff.propose": "Propose handoff",
838
+ "chap.handoff.accept": "Accept handoff",
839
+ "chap.handoff.decline": "Decline handoff",
840
+ "chap.control.pause": "Pause work",
841
+ "chap.control.resume": "Resume work",
842
+ "chap.control.cancel": "Cancel task",
843
+ "chap.control.snapshot": "Snapshot workspace",
844
+ "chap.control.rollback": "Roll back to snapshot",
845
+ "chap.control.supersede": "Supersede task",
846
+ "chap.control.set_mode_ceiling": "Set mode ceiling",
847
+ "chap.task.route": "Route task to an assignee",
848
+ "chap.review.depth": "Decide review depth",
849
+ "chap.escalate.auto": "Evaluate auto-escalation",
850
+ "chap.participant.rotate_key": "Rotate signing key",
851
+ "chap.participant.revoke_key": "Revoke signing key",
852
+ "chap.audit.submit_to_scitt": "Anchor audit log in SCITT",
853
+ "chap.audit.verify_receipt": "Verify SCITT receipt",
854
+ "chap.audit.verify_chain": "Verify audit chain"
855
+ };
856
+ var TOOL_ANNOTATIONS = Object.fromEntries(
857
+ Object.keys(TOOL_DESCRIPTIONS).map((name) => [name, {
858
+ title: TITLES[name] ?? name,
859
+ readOnlyHint: READ_ONLY.has(name),
860
+ // Meaningful only when readOnlyHint is false, per the specification.
861
+ destructiveHint: DESTRUCTIVE.has(name),
862
+ idempotentHint: IDEMPOTENT.has(name),
863
+ openWorldHint: OPEN_WORLD.has(name)
864
+ }])
865
+ );
763
866
 
764
867
  // src/envelope.ts
765
868
  import { ErrorCode } from "@modelcontextprotocol/sdk/types.js";
@@ -822,7 +925,7 @@ var ServerDiscoverRequestSchema = z.object({
822
925
  function makeChapMcpServer(coord, options = {}) {
823
926
  const serverInfo = {
824
927
  name: options.name ?? "chap",
825
- version: options.version ?? "0.2.13"
928
+ version: options.version ?? "0.3.1"
826
929
  };
827
930
  const server = new Server(
828
931
  serverInfo,
@@ -835,12 +938,20 @@ function makeChapMcpServer(coord, options = {}) {
835
938
  let counter = 0;
836
939
  const nextId = options.envelopeIdFactory ?? (() => `mcp-${++counter}`);
837
940
  const filter = options.toolFilter ?? (() => true);
838
- const enabledTools = TOOL_NAMES.filter((name) => filter(name) && methodForTool(name) !== null).map((name) => ({
839
- name,
840
- title: name,
841
- description: TOOL_DESCRIPTIONS[name] ?? `CHAP method ${methodForTool(name)}.`,
842
- inputSchema: SCHEMAS[name]
843
- }));
941
+ const enabledTools = TOOL_NAMES.filter((name) => filter(name) && methodForTool(name) !== null).map((name) => {
942
+ const ann = TOOL_ANNOTATIONS[name];
943
+ return {
944
+ name,
945
+ // The title was the tool name, which told a reader nothing they could
946
+ // not already see. The annotation carries a readable one.
947
+ title: ann?.title ?? name,
948
+ description: TOOL_DESCRIPTIONS[name] ?? `CHAP method ${methodForTool(name)}.`,
949
+ inputSchema: SCHEMAS[name],
950
+ // Behavioural hints. Without these a client has only the prose to go
951
+ // on when deciding whether a call is safe to make or to retry.
952
+ ...ann ? { annotations: ann } : {}
953
+ };
954
+ });
844
955
  server.setRequestHandler(ListToolsRequestSchema, async (request) => {
845
956
  const era = classifyEnvelope(request.params);
846
957
  if (era === "legacy") return { tools: enabledTools };
@@ -860,7 +971,7 @@ function makeChapMcpServer(coord, options = {}) {
860
971
  resultType: "complete",
861
972
  supportedVersions: SUPPORTED_PROTOCOL_VERSIONS,
862
973
  capabilities: { tools: {} },
863
- instructions: "CHAP Coordinator exposed as MCP tools. Every tool call is recorded on the CHAP audit log; governed methods enforce membership and review rules server-side.",
974
+ instructions: "CHAP Coordinator exposed as MCP tools. Every accepted call that changes state is recorded on the CHAP audit log, as is a member's refused attempt at a governed action. Governed methods enforce membership and review rules server-side.",
864
975
  ttlMs: LIST_TTL_MS,
865
976
  cacheScope: "public",
866
977
  _meta: { [META_SERVER_INFO]: serverInfo }
@@ -943,6 +1054,7 @@ export {
943
1054
  SCHEMAS,
944
1055
  SUPPORTED_PROTOCOL_VERSIONS,
945
1056
  ServerDiscoverRequestSchema,
1057
+ TOOL_ANNOTATIONS,
946
1058
  TOOL_DESCRIPTIONS,
947
1059
  TOOL_NAMES,
948
1060
  UNSUPPORTED_PROTOCOL_VERSION,