|
2 | 2 |
|
3 | 3 | ## Purpose |
4 | 4 |
|
5 | | -This appendix provides language-neutral example request and response shapes for key `codex-mem` tools. |
| 5 | +This appendix provides language-neutral example request and response shapes for the current `codex-mem` v1 MCP tools. |
6 | 6 |
|
7 | 7 | These examples illustrate intent and semantics. They are not tied to one implementation language. |
8 | 8 |
|
@@ -133,6 +133,86 @@ These examples illustrate intent and semantics. They are not tied to one impleme |
133 | 133 | } |
134 | 134 | ``` |
135 | 135 |
|
| 136 | +## `memory_resolve_scope` |
| 137 | + |
| 138 | +### Example request |
| 139 | + |
| 140 | +```json |
| 141 | +{ |
| 142 | + "cwd": "D:/Code/go/order-web", |
| 143 | + "branch_name": "fix/order-validation", |
| 144 | + "repo_remote": "git@github.com:example/order-web.git", |
| 145 | + "project_name_hint": "order-web", |
| 146 | + "system_name_hint": "order-platform" |
| 147 | +} |
| 148 | +``` |
| 149 | + |
| 150 | +### Example response |
| 151 | + |
| 152 | +```json |
| 153 | +{ |
| 154 | + "ok": true, |
| 155 | + "data": { |
| 156 | + "scope": { |
| 157 | + "system_id": "sys_order_platform", |
| 158 | + "system_name": "order-platform", |
| 159 | + "project_id": "proj_order_web", |
| 160 | + "project_name": "order-web", |
| 161 | + "workspace_id": "ws_order_web_main", |
| 162 | + "workspace_root": "D:/Code/go/order-web", |
| 163 | + "branch_name": "fix/order-validation", |
| 164 | + "resolved_by": "repo_remote" |
| 165 | + }, |
| 166 | + "resolved_by": "repo_remote" |
| 167 | + }, |
| 168 | + "warnings": [] |
| 169 | +} |
| 170 | +``` |
| 171 | + |
| 172 | +## `memory_start_session` |
| 173 | + |
| 174 | +### Example request |
| 175 | + |
| 176 | +```json |
| 177 | +{ |
| 178 | + "scope": { |
| 179 | + "system_id": "sys_order_platform", |
| 180 | + "system_name": "order-platform", |
| 181 | + "project_id": "proj_order_web", |
| 182 | + "project_name": "order-web", |
| 183 | + "workspace_id": "ws_order_web_main", |
| 184 | + "workspace_root": "D:/Code/go/order-web", |
| 185 | + "branch_name": "fix/order-validation", |
| 186 | + "resolved_by": "repo_remote" |
| 187 | + }, |
| 188 | + "task": "Continue fixing order submission validation", |
| 189 | + "branch_name": "fix/order-validation" |
| 190 | +} |
| 191 | +``` |
| 192 | + |
| 193 | +### Example response |
| 194 | + |
| 195 | +```json |
| 196 | +{ |
| 197 | + "ok": true, |
| 198 | + "data": { |
| 199 | + "session": { |
| 200 | + "session_id": "sess_20260313_001", |
| 201 | + "scope": { |
| 202 | + "system_id": "sys_order_platform", |
| 203 | + "project_id": "proj_order_web", |
| 204 | + "workspace_id": "ws_order_web_main" |
| 205 | + }, |
| 206 | + "status": "active", |
| 207 | + "task": "Continue fixing order submission validation", |
| 208 | + "branch_name": "fix/order-validation", |
| 209 | + "started_at": "2026-03-13T10:30:00Z" |
| 210 | + } |
| 211 | + }, |
| 212 | + "warnings": [] |
| 213 | +} |
| 214 | +``` |
| 215 | + |
136 | 216 | ## `memory_save_note` |
137 | 217 |
|
138 | 218 | ### Example request |
@@ -299,6 +379,8 @@ These examples illustrate intent and semantics. They are not tied to one impleme |
299 | 379 | } |
300 | 380 | ``` |
301 | 381 |
|
| 382 | +Replay of the same imported artifact or a privacy-blocked import still returns `ok: true`, but the payload flips to `suppressed: true` and includes warning visibility instead of silently writing another durable record. |
| 383 | + |
302 | 384 | ## `memory_save_imported_note` |
303 | 385 |
|
304 | 386 | ### Example request |
@@ -370,6 +452,8 @@ These examples illustrate intent and semantics. They are not tied to one impleme |
370 | 452 | } |
371 | 453 | ``` |
372 | 454 |
|
| 455 | +When explicit project memory already covers the same artifact, or privacy rules exclude durable storage, the response still preserves the import audit while `materialized` becomes `false` and `suppressed` becomes `true`. |
| 456 | + |
373 | 457 | ## `memory_search` |
374 | 458 |
|
375 | 459 | ### Example request |
@@ -431,3 +515,167 @@ These examples illustrate intent and semantics. They are not tied to one impleme |
431 | 515 | "warnings": [] |
432 | 516 | } |
433 | 517 | ``` |
| 518 | + |
| 519 | +## `memory_get_recent` |
| 520 | + |
| 521 | +### Example request |
| 522 | + |
| 523 | +```json |
| 524 | +{ |
| 525 | + "scope": { |
| 526 | + "system_id": "sys_order_platform", |
| 527 | + "project_id": "proj_order_web", |
| 528 | + "workspace_id": "ws_order_web_main" |
| 529 | + }, |
| 530 | + "limit": 3, |
| 531 | + "include_handoffs": true, |
| 532 | + "include_notes": true, |
| 533 | + "include_related_projects": false |
| 534 | +} |
| 535 | +``` |
| 536 | + |
| 537 | +### Example response |
| 538 | + |
| 539 | +```json |
| 540 | +{ |
| 541 | + "ok": true, |
| 542 | + "data": { |
| 543 | + "handoffs": [ |
| 544 | + { |
| 545 | + "handoff_id": "handoff_115", |
| 546 | + "scope": { |
| 547 | + "system_id": "sys_order_platform", |
| 548 | + "project_id": "proj_order_web", |
| 549 | + "workspace_id": "ws_order_web_main" |
| 550 | + }, |
| 551 | + "session_id": "sess_20260313_001", |
| 552 | + "kind": "final", |
| 553 | + "task": "Fix order validation mismatch", |
| 554 | + "summary": "Validation logic has been aligned, but draft checkout regression still needs confirmation.", |
| 555 | + "next_steps": [ |
| 556 | + "Run regression test on saved draft checkout flow", |
| 557 | + "Confirm no legacy alias references remain" |
| 558 | + ], |
| 559 | + "status": "open", |
| 560 | + "created_at": "2026-03-13T11:10:00Z" |
| 561 | + } |
| 562 | + ], |
| 563 | + "notes": [ |
| 564 | + { |
| 565 | + "note_id": "note_488", |
| 566 | + "scope": { |
| 567 | + "system_id": "sys_order_platform", |
| 568 | + "project_id": "proj_order_web", |
| 569 | + "workspace_id": "ws_order_web_main" |
| 570 | + }, |
| 571 | + "session_id": "sess_20260313_001", |
| 572 | + "type": "discovery", |
| 573 | + "title": "Watcher captured checkout retry regression", |
| 574 | + "content": "A local watcher run showed the checkout retry button still posts a legacy payment alias after draft restore.", |
| 575 | + "importance": 4, |
| 576 | + "status": "active", |
| 577 | + "source": "watcher_import", |
| 578 | + "created_at": "2026-03-13T11:24:00Z" |
| 579 | + }, |
| 580 | + { |
| 581 | + "note_id": "note_402", |
| 582 | + "scope": { |
| 583 | + "system_id": "sys_order_platform", |
| 584 | + "project_id": "proj_order_web", |
| 585 | + "workspace_id": "ws_order_web_main" |
| 586 | + }, |
| 587 | + "session_id": "sess_20260313_001", |
| 588 | + "type": "bugfix", |
| 589 | + "title": "Order validation now uses generated backend enum list", |
| 590 | + "content": "Client-side validation now reads generated enum metadata instead of maintaining a stale manual list.", |
| 591 | + "importance": 4, |
| 592 | + "status": "active", |
| 593 | + "source": "codex_explicit", |
| 594 | + "created_at": "2026-03-13T10:52:00Z" |
| 595 | + } |
| 596 | + ] |
| 597 | + }, |
| 598 | + "warnings": [] |
| 599 | +} |
| 600 | +``` |
| 601 | + |
| 602 | +## `memory_get_note` |
| 603 | + |
| 604 | +### Example request |
| 605 | + |
| 606 | +```json |
| 607 | +{ |
| 608 | + "id": "note_488", |
| 609 | + "kind": "note" |
| 610 | +} |
| 611 | +``` |
| 612 | + |
| 613 | +### Example response |
| 614 | + |
| 615 | +```json |
| 616 | +{ |
| 617 | + "ok": true, |
| 618 | + "data": { |
| 619 | + "record": { |
| 620 | + "note_id": "note_488", |
| 621 | + "scope": { |
| 622 | + "system_id": "sys_order_platform", |
| 623 | + "project_id": "proj_order_web", |
| 624 | + "workspace_id": "ws_order_web_main" |
| 625 | + }, |
| 626 | + "session_id": "sess_20260313_001", |
| 627 | + "type": "discovery", |
| 628 | + "title": "Watcher captured checkout retry regression", |
| 629 | + "content": "A local watcher run showed the checkout retry button still posts a legacy payment alias after draft restore.", |
| 630 | + "importance": 4, |
| 631 | + "status": "active", |
| 632 | + "source": "watcher_import", |
| 633 | + "created_at": "2026-03-13T11:24:00Z" |
| 634 | + } |
| 635 | + }, |
| 636 | + "warnings": [] |
| 637 | +} |
| 638 | +``` |
| 639 | + |
| 640 | +## `memory_install_agents` |
| 641 | + |
| 642 | +### Example request |
| 643 | + |
| 644 | +```json |
| 645 | +{ |
| 646 | + "target": "project", |
| 647 | + "mode": "safe", |
| 648 | + "cwd": "D:/Code/go/order-web", |
| 649 | + "project_name": "order-web", |
| 650 | + "system_name": "order-platform", |
| 651 | + "related_repositories": [ |
| 652 | + "order-api", |
| 653 | + "order-worker" |
| 654 | + ], |
| 655 | + "preferred_tags": [ |
| 656 | + "spec", |
| 657 | + "api", |
| 658 | + "go" |
| 659 | + ], |
| 660 | + "allow_related_project_memory": true |
| 661 | +} |
| 662 | +``` |
| 663 | + |
| 664 | +### Example response |
| 665 | + |
| 666 | +```json |
| 667 | +{ |
| 668 | + "ok": true, |
| 669 | + "data": { |
| 670 | + "written_files": [ |
| 671 | + { |
| 672 | + "path": "D:/Code/go/order-web/AGENTS.md", |
| 673 | + "target": "project", |
| 674 | + "mode": "safe" |
| 675 | + } |
| 676 | + ], |
| 677 | + "skipped_files": [] |
| 678 | + }, |
| 679 | + "warnings": [] |
| 680 | +} |
| 681 | +``` |
0 commit comments