warmplane 0.18.0

Local control plane that keeps MCP sessions warm with compact capability/resource/prompt facades.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
openapi: 3.1.0
info:
  title: Warmplane HTTP Facade API
  version: "v1"
  description: |
    Warmplane exposes a compact, deterministic HTTP facade over multiple upstream MCP servers.

    This API is index-first: list compact capability/resource/prompt entries, then request detail
    or execute operations on-demand.
servers:
  - url: http://127.0.0.1:9090
    description: local default
paths:
  /v1/capabilities:
    get:
      summary: List capabilities
      operationId: listCapabilities
      responses:
        "200":
          description: Capability index with cache hints
          headers:
            ETag:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CapabilitiesListResponse"
        "304":
          description: Not Modified (catalog unchanged)
  /v1/capabilities/search:
    post:
      summary: Search capabilities
      operationId: searchCapabilities
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchCapabilitiesRequest"
      responses:
        "200":
          description: Ranked search results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchCapabilitiesResponse"
  /v1/capabilities/{id}:
    get:
      summary: Describe capability
      operationId: describeCapability
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Capability detail
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CapabilityDescribeResponse"
        "404":
          description: Capability not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /v1/tools/call:
    post:
      summary: Execute capability
      operationId: callCapability
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CallCapabilityRequest"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SuccessEnvelope"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Policy blocked
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Capability not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "502":
          description: Upstream error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "504":
          description: Upstream timeout
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /v1/tools/batch_call:
    post:
      summary: Execute chained multi-step batch capabilities
      operationId: batchCallCapabilities
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BatchCallRequest"
      responses:
        "200":
          description: Batch execution summary response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BatchCallResponse"
  /v1/resources:
    get:
      summary: List resources
      operationId: listResources
      responses:
        "200":
          description: Resource index with cache hints
          headers:
            ETag:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResourcesListResponse"
        "304":
          description: Not Modified (catalog unchanged)
  /v1/resources/read:
    post:
      summary: Read resource
      operationId: readResource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReadResourceRequest"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SuccessEnvelope"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Policy blocked
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "502":
          description: Upstream error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "504":
          description: Upstream timeout
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /v1/resources/updates:
    get:
      summary: Real-time resource update SSE feed
      operationId: resourceUpdates
      responses:
        "200":
          description: SSE event stream
          content:
            text/event-stream:
              schema:
                type: string
  /v1/prompts:
    get:
      summary: List prompts
      operationId: listPrompts
      responses:
        "200":
          description: Prompt index with cache hints
          headers:
            ETag:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PromptsListResponse"
        "304":
          description: Not Modified (catalog unchanged)
  /v1/prompts/get:
    post:
      summary: Get prompt output
      operationId: getPrompt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GetPromptRequest"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SuccessEnvelope"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Policy blocked
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Prompt not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "502":
          description: Upstream error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "504":
          description: Upstream timeout
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /v1/catalog/events:
    get:
      summary: Catalog mutation events change feed
      operationId: catalogEvents
      parameters:
        - in: query
          name: after
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Event log feed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CatalogEventsResponse"
  /v1/completion/complete:
    post:
      summary: Argument completion for prompt or resource
      operationId: completeArgument
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CompletionRequest"
      responses:
        "200":
          description: Completion candidate results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompletionResponse"
  /v1/sampling/create_message:
    post:
      summary: Sampling completion delegation
      operationId: samplingCreateMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SamplingRequest"
      responses:
        "200":
          description: Sampling response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SamplingResponse"
  /v1/config:
    get:
      summary: Get active configuration and metrics
      operationId: getConfig
      responses:
        "200":
          description: Active configuration and runtime metrics
  /v1/config/servers:
    post:
      summary: Upsert upstream server with hot-mounting
      operationId: upsertServer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpsertServerRequest"
      responses:
        "200":
          description: Server upserted and mounted
  /v1/config/servers/{id}:
    delete:
      summary: Delete upstream server and unmount dynamically
      operationId: deleteServer
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Server deleted and unmounted
  /v1/config/ecosystem:
    get:
      summary: Discover external MCP server configurations from Claude Desktop, Cursor, or Zed
      operationId: getEcosystemSources
      responses:
        "200":
          description: Discovered ecosystem configuration files and servers
  /v1/config/import:
    post:
      summary: Import MCP servers from external client configurations
      operationId: importConfig
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ImportConfigRequest"
      responses:
        "200":
          description: Summary of imported servers
  /v1/config/alias:
    post:
      summary: Add or remove capability, resource, or prompt aliases
      operationId: updateAlias
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateAliasRequest"
      responses:
        "200":
          description: Alias updated
  /v1/config/policy:
    post:
      summary: Update security policy rules, approval requirements, and redaction keys
      operationId: updatePolicy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PolicyConfig"
      responses:
        "200":
          description: Policy updated
  /v1/config/reload:
    post:
      summary: Hot-reload daemon configuration and upstream servers from disk
      operationId: reloadConfig
      responses:
        "200":
          description: Summary of mounted, unmounted, and updated servers
  /v1/approvals:
    get:
      summary: List pending and resolved human approval tickets
      operationId: listApprovals
      responses:
        "200":
          description: List of approval tickets
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListApprovalsResponse"
  /v1/approvals/{id}:
    get:
      summary: Get details and sanitized parameters for an approval ticket
      operationId: getApproval
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Approval ticket details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetApprovalResponse"
        "404":
          description: Approval ticket not found
  /v1/approvals/{id}/approve:
    post:
      summary: Approve a suspended capability execution
      operationId: approveTicket
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ApproveTicketRequest"
      responses:
        "200":
          description: Ticket approved and execution resumed
        "409":
          description: Ticket is not pending or already resolved
  /v1/approvals/{id}/reject:
    post:
      summary: Reject a suspended capability execution
      operationId: rejectTicket
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RejectTicketRequest"
      responses:
        "200":
          description: Ticket rejected
        "409":
          description: Ticket is not pending or already resolved
  /v1/audit/events:
    get:
      summary: Query paginated WORM audit events with filters
      operationId: listAuditEvents
      parameters:
        - in: query
          name: actor_id
          schema:
            type: string
        - in: query
          name: capability_id
          schema:
            type: string
        - in: query
          name: event_type
          schema:
            type: string
        - in: query
          name: limit
          schema:
            type: integer
            default: 50
        - in: query
          name: offset
          schema:
            type: integer
            default: 0
      responses:
        "200":
          description: List of audit events
  /v1/audit/events/{id}:
    get:
      summary: Get details of a single audit event record
      operationId: getAuditEvent
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Audit event record
        "404":
          description: Audit event not found
  /v1/audit/verify:
    get:
      summary: Verify complete cryptographic SHA-256 hash chain integrity
      operationId: verifyAuditChain
      responses:
        "200":
          description: Hash chain verification report
  /v1/audit/stats:
    get:
      summary: Retrieve summary metrics and event breakdown of the audit log
      operationId: getAuditStats
      responses:
        "200":
          description: Aggregate audit statistics
  /v1/audit/export:
    get:
      summary: Export raw audit log as JSONL or CSV file attachment
      operationId: exportAuditLog
      parameters:
        - in: query
          name: format
          schema:
            type: string
            enum: [jsonl, csv]
            default: jsonl
      responses:
        "200":
          description: Streamed audit log file
  /v1/operations/{id}/cancel:
    post:
      summary: Cancel in-flight operation
      operationId: cancelOperation
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Operation cancelled
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  request_id:
                    type: string
                  cancelled:
                    type: boolean
components:
  schemas:
    CapabilityListItem:
      type: object
      required: [id, summary, server, tool, tags]
      properties:
        id:
          type: string
        summary:
          type: string
        server:
          type: string
        tool:
          type: string
        tags:
          type: array
          items:
            type: string
    ResourceListItem:
      type: object
      required: [id, server, uri, name, tags]
      properties:
        id:
          type: string
        server:
          type: string
        uri:
          type: string
        name:
          type: string
        description:
          type: [string, "null"]
        mime_type:
          type: [string, "null"]
        tags:
          type: array
          items:
            type: string
    PromptListItem:
      type: object
      required: [id, server, name, arguments, tags]
      properties:
        id:
          type: string
        server:
          type: string
        name:
          type: string
        title:
          type: [string, "null"]
        description:
          type: [string, "null"]
        arguments:
          type: array
          items:
            type: object
        tags:
          type: array
          items:
            type: string
    CapabilitiesListResponse:
      type: object
      required: [version, catalog_version, ttl_ms, cache_scope, capabilities]
      properties:
        version:
          type: string
          const: v1
        catalog_version:
          type: string
        ttl_ms:
          type: integer
          example: 300000
        cache_scope:
          type: string
          example: "public"
        capabilities:
          type: array
          items:
            $ref: "#/components/schemas/CapabilityListItem"
    CapabilityDescribeResponse:
      type: object
      required: [version, capability]
      properties:
        version:
          type: string
          const: v1
        catalog_version:
          type: string
        capability:
          type: object
          required: [id, server, tool, description, input_schema, examples]
          properties:
            id:
              type: string
            server:
              type: string
            tool:
              type: string
            description:
              type: string
            input_schema:
              type: object
            examples:
              type: array
              items: {}
    ResourcesListResponse:
      type: object
      required: [version, catalog_version, ttl_ms, cache_scope, resources]
      properties:
        version:
          type: string
          const: v1
        catalog_version:
          type: string
        ttl_ms:
          type: integer
          example: 300000
        cache_scope:
          type: string
          example: "public"
        resources:
          type: array
          items:
            $ref: "#/components/schemas/ResourceListItem"
    PromptsListResponse:
      type: object
      required: [version, catalog_version, ttl_ms, cache_scope, prompts]
      properties:
        version:
          type: string
          const: v1
        catalog_version:
          type: string
        ttl_ms:
          type: integer
          example: 300000
        cache_scope:
          type: string
          example: "public"
        prompts:
          type: array
          items:
            $ref: "#/components/schemas/PromptListItem"
    SearchCapabilitiesRequest:
      type: object
      properties:
        query:
          type: [string, "null"]
        limit:
          type: integer
          default: 8
        server_ids:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        modes:
          type: array
          items:
            type: string
    SearchCapabilitiesResponse:
      type: object
      required: [version, catalog_version, capabilities]
      properties:
        version:
          type: string
        catalog_version:
          type: string
        capabilities:
          type: array
          items:
            type: object
    CallCapabilityRequest:
      type: object
      required: [capability_id, args]
      properties:
        capability_id:
          type: string
        args:
          type: object
        request_id:
          type: [string, "null"]
        context:
          $ref: "#/components/schemas/RequestContext"
        idempotency_key:
          type: [string, "null"]
        input_responses:
          type: [object, "null"]
          description: MRTR client responses for interactive tool turns
        request_state:
          type: [string, "null"]
          description: MRTR opaque state string
    ReadResourceRequest:
      type: object
      required: [resource_id]
      properties:
        resource_id:
          type: string
        request_id:
          type: [string, "null"]
        context:
          $ref: "#/components/schemas/RequestContext"
        idempotency_key:
          type: [string, "null"]
        input_responses:
          type: [object, "null"]
        request_state:
          type: [string, "null"]
    GetPromptRequest:
      type: object
      required: [prompt_id]
      properties:
        prompt_id:
          type: string
        arguments:
          type: [object, "null"]
        request_id:
          type: [string, "null"]
        context:
          $ref: "#/components/schemas/RequestContext"
        idempotency_key:
          type: [string, "null"]
        input_responses:
          type: [object, "null"]
        request_state:
          type: [string, "null"]
    CompletionRequest:
      type: object
      required: [ref_type, ref_name, argument_name]
      properties:
        ref_type:
          type: string
          enum: [prompt, resource]
        ref_name:
          type: string
        argument_name:
          type: string
        argument_value:
          type: string
    CompletionResponse:
      type: object
      properties:
        ok:
          type: boolean
        trace_id:
          type: string
        data:
          type: object
    SamplingRequest:
      type: object
      required: [server_id, messages]
      properties:
        server_id:
          type: string
        messages:
          type: array
          items:
            type: object
        max_tokens:
          type: [integer, "null"]
    SamplingResponse:
      type: object
      properties:
        ok:
          type: boolean
        trace_id:
          type: string
        data:
          type: object
    CatalogEventsResponse:
      type: object
      required: [catalog_version, cursor, events]
      properties:
        catalog_version:
          type: string
        cursor:
          type: string
        events:
          type: array
          items:
            type: object
    RequestContext:
      type: object
      properties:
        operation_id:
          type: [string, "null"]
        work_item_id:
          type: [string, "null"]
        actor_id:
          type: [string, "null"]
        grant_id:
          type: [string, "null"]
    RetryMetadata:
      type: object
      required: [classification, upstream_execution_state]
      properties:
        classification:
          type: string
          enum: [safe, unsafe, idempotent]
        upstream_execution_state:
          type: string
          enum: [not_started, completed, unknown]
    ServerConfig:
      type: object
      properties:
        command:
          type: [string, "null"]
        args:
          type: array
          items:
            type: string
        env:
          type: object
          additionalProperties:
            type: string
        url:
          type: [string, "null"]
        protocolVersion:
          type: [string, "null"]
          example: "2026-07-28"
        allowStateless:
          type: [boolean, "null"]
        headers:
          type: object
          additionalProperties:
            type: string
        auth:
          type: object
        resilience:
          $ref: "#/components/schemas/ResilienceConfig"
    UpsertServerRequest:
      type: object
      required: [name, server]
      properties:
        name:
          type: string
        server:
          $ref: "#/components/schemas/ServerConfig"
    ImportConfigRequest:
      type: object
      properties:
        source_path:
          type: [string, "null"]
        overwrite:
          type: [boolean, "null"]
    UpdateAliasRequest:
      type: object
      required: [kind, alias]
      properties:
        kind:
          type: string
          enum: [tool, resource, prompt]
        alias:
          type: string
        target:
          type: [string, "null"]
    WebhookConfig:
      type: object
      required: [url]
      properties:
        url:
          type: string
        secret:
          type: [string, "null"]
        secret_env:
          type: [string, "null"]
        auth_header:
          type: [string, "null"]
        headers:
          type: object
          additionalProperties:
            type: string
    PolicyConfig:
      type: object
      properties:
        allow:
          type: array
          items:
            type: string
        deny:
          type: array
          items:
            type: string
        require_approval:
          type: array
          items:
            type: string
        approval_timeout_secs:
          type: integer
        redact_keys:
          type: array
          items:
            type: string
        webhook:
          $ref: "#/components/schemas/WebhookConfig"
    ApprovalStatus:
      type: object
      required: [status]
      properties:
        status:
          type: string
          enum: [pending, approved, rejected, expired]
        operator:
          type: string
        timestamp:
          type: integer
        reason:
          type: string
        modified_args:
          type: object
    ApprovalTicket:
      type: object
      required: [id, capability_id, server_id, args, sanitized_args, status, created_at, expires_at]
      properties:
        id:
          type: string
        capability_id:
          type: string
        server_id:
          type: string
        args:
          type: object
        sanitized_args:
          type: object
        request_id:
          type: [string, "null"]
        status:
          $ref: "#/components/schemas/ApprovalStatus"
        created_at:
          type: integer
        expires_at:
          type: integer
    ListApprovalsResponse:
      type: object
      required: [ok, approvals, total]
      properties:
        ok:
          type: boolean
        approvals:
          type: array
          items:
            $ref: "#/components/schemas/ApprovalTicket"
        total:
          type: integer
    GetApprovalResponse:
      type: object
      required: [ok, approval]
      properties:
        ok:
          type: boolean
        approval:
          $ref: "#/components/schemas/ApprovalTicket"
    ApproveTicketRequest:
      type: object
      required: [operator]
      properties:
        operator:
          type: string
        modified_args:
          type: object
    RejectTicketRequest:
      type: object
      required: [operator]
      properties:
        operator:
          type: string
        reason:
          type: string
    SuccessEnvelope:
      type: object
      required: [ok, request_id, trace_id, data, error, retry]
      properties:
        ok:
          type: boolean
          const: true
        request_id:
          type: [string, "null"]
        trace_id:
          type: string
        context:
          $ref: "#/components/schemas/RequestContext"
        retry:
          $ref: "#/components/schemas/RetryMetadata"
        data: {}
        error:
          type: "null"
    ErrorEnvelope:
      type: object
      required: [ok, request_id, trace_id, data, error, retry]
      properties:
        ok:
          type: boolean
          const: false
        request_id:
          type: [string, "null"]
        trace_id:
          type: string
        context:
          $ref: "#/components/schemas/RequestContext"
        retry:
          $ref: "#/components/schemas/RetryMetadata"
        data:
          type: "null"
        error:
          type: object
          required: [code, message, retryable]
          properties:
            code:
              type: string
              enum:
                - TOOL_NOT_FOUND
                - RESOURCE_NOT_FOUND
                - PROMPT_NOT_FOUND
                - SERVER_UNREACHABLE
                - INVALID_ARGS
                - UPSTREAM_TIMEOUT
                - UPSTREAM_ERROR
                - POLICY_DENIED
                - APPROVAL_PENDING
                - APPROVAL_TIMEOUT
                - APPROVAL_REJECTED
                - CIRCUIT_OPEN
                - OPERATION_CANCELLED
                - INTERNAL_ERROR
            message:
              type: string
            retryable:
              type: boolean
    ResilienceConfig:
      type: object
      properties:
        failureThreshold:
          type: integer
          default: 3
          description: Consecutive failure threshold before tripping circuit to Open
        cooldownMs:
          type: integer
          default: 30000
          description: Cooldown duration in milliseconds before testing recovery in HalfOpen
        consecutiveSuccesses:
          type: integer
          default: 2
          description: Consecutive successful probes in HalfOpen to reset circuit to Closed
        autoRestart:
          type: boolean
          default: true
          description: Automatically restart crashed stdio child processes
        maxRestarts:
          type: integer
          default: 5
          description: Maximum restart attempts before giving up
        healthCheckIntervalSecs:
          type: [integer, "null"]
    BatchStep:
      type: object
      required: [id, capability_id, args]
      properties:
        id:
          type: string
          description: Unique step identifier within the batch (e.g. step1)
        capability_id:
          type: string
          description: Capability ID to invoke
        args:
          type: object
          description: Arguments object, supporting $step_id.field reference interpolation
        continue_on_error:
          type: boolean
          default: false
          description: Whether to continue executing subsequent steps if this step fails
    BatchCallRequest:
      type: object
      required: [steps]
      properties:
        steps:
          type: array
          items:
            $ref: "#/components/schemas/BatchStep"
        request_id:
          type: [string, "null"]
        context:
          $ref: "#/components/schemas/RequestContext"
    BatchStepResult:
      type: object
      required: [id, capability_id, ok, duration_us]
      properties:
        id:
          type: string
        capability_id:
          type: string
        ok:
          type: boolean
        data: {}
        error:
          type: [string, "null"]
        duration_us:
          type: integer
    BatchCallResponse:
      type: object
      required: [ok, trace_id, results, total_duration_us]
      properties:
        ok:
          type: boolean
        request_id:
          type: [string, "null"]
        trace_id:
          type: string
        results:
          type: array
          items:
            $ref: "#/components/schemas/BatchStepResult"
        total_duration_us:
          type: integer