@wowok/skills 1.0.6

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.
Files changed (70) hide show
  1. package/README.md +156 -0
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +177 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +19 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/skills.d.ts +5 -0
  11. package/dist/skills.d.ts.map +1 -0
  12. package/dist/skills.js +46 -0
  13. package/dist/skills.js.map +1 -0
  14. package/dist/types.d.ts +9 -0
  15. package/dist/types.d.ts.map +1 -0
  16. package/dist/types.js +3 -0
  17. package/dist/types.js.map +1 -0
  18. package/examples/Insurance/Insurance.md +594 -0
  19. package/examples/Insurance/Insurance_TestResults.md +481 -0
  20. package/examples/Insurance/insurance_complete_guard_v1.json +50 -0
  21. package/examples/MyShop/MyShop.md +1353 -0
  22. package/examples/MyShop/MyShop_TestResults.md +1003 -0
  23. package/examples/MyShop_Advanced/MyShop_Advanced.md +1898 -0
  24. package/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +1297 -0
  25. package/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +743 -0
  26. package/examples/MyShop_Advanced/machine_nodes.json +222 -0
  27. package/examples/ThreeBody_Signature/ThreeBody_Signature.md +776 -0
  28. package/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +599 -0
  29. package/examples/Travel/Travel.md +1157 -0
  30. package/examples/Travel/Travel_TestResults.md +743 -0
  31. package/examples/Travel/calc-weather-timestamps.js +8 -0
  32. package/examples/Travel/travel_machine_v2_export.json +104 -0
  33. package/examples/Travel/weather_check_guard_v1.json +51 -0
  34. package/package.json +56 -0
  35. package/schemas/onchain_operations/_common.md +236 -0
  36. package/schemas/onchain_operations/_index.md +22 -0
  37. package/schemas/onchain_operations/allocation.md +50 -0
  38. package/schemas/onchain_operations/arbitration.md +95 -0
  39. package/schemas/onchain_operations/contact.md +36 -0
  40. package/schemas/onchain_operations/demand.md +52 -0
  41. package/schemas/onchain_operations/gen_passport.md +43 -0
  42. package/schemas/onchain_operations/guard.md +136 -0
  43. package/schemas/onchain_operations/machine.md +70 -0
  44. package/schemas/onchain_operations/order.md +57 -0
  45. package/schemas/onchain_operations/payment.md +32 -0
  46. package/schemas/onchain_operations/permission.md +57 -0
  47. package/schemas/onchain_operations/personal.md +59 -0
  48. package/schemas/onchain_operations/progress.md +35 -0
  49. package/schemas/onchain_operations/repository.md +81 -0
  50. package/schemas/onchain_operations/reward.md +40 -0
  51. package/schemas/onchain_operations/service.md +104 -0
  52. package/schemas/onchain_operations/treasury.md +74 -0
  53. package/schemas/schema-account_operation.md +402 -0
  54. package/schemas/schema-guard2file.md +153 -0
  55. package/schemas/schema-local_info_operation.md +160 -0
  56. package/schemas/schema-local_mark_operation.md +148 -0
  57. package/schemas/schema-machineNode2file.md +155 -0
  58. package/schemas/schema-messenger_operation.md +547 -0
  59. package/schemas/schema-onchain_events.md +201 -0
  60. package/schemas/schema-onchain_table_data.md +334 -0
  61. package/schemas/schema-query_toolkit.md +375 -0
  62. package/schemas/schema-wip_file.md +240 -0
  63. package/schemas/schema-wowok_buildin_info.md +296 -0
  64. package/scripts/install.js +113 -0
  65. package/wowok-build/SKILL.md +606 -0
  66. package/wowok-guard/SKILL.md +374 -0
  67. package/wowok-machine/SKILL.md +512 -0
  68. package/wowok-order/SKILL.md +499 -0
  69. package/wowok-safety/SKILL.md +381 -0
  70. package/wowok-tools/SKILL.md +635 -0
@@ -0,0 +1,635 @@
1
+ ---
2
+ name: wowok-tools
3
+ description: |
4
+ Definitive WoWok MCP tool usage reference — the authoritative fallback when
5
+ MCP tool schemas are unavailable. Covers ALL 13 tools with complete parameter
6
+ structures, operation types, query types, discriminated unions, and nested
7
+ sub-field schemas. Prevents the most common AI failures: wrong tool selection,
8
+ incorrect parameter formats, missing required fields, wrong discriminated
9
+ union branches, and stale cache issues.
10
+
11
+ Use this skill when:
12
+ - AI needs to select or invoke any WoWok MCP tool
13
+ - AI is unsure which tool fits a task
14
+ - AI needs exact parameter format for a specific operation_type
15
+ - AI encounters a tool error and needs troubleshooting
16
+ - MCP tool schemas are not auto-available in the current environment
17
+ - User asks "how do I..." for any WoWok operation
18
+ - AI needs to verify parameter types before calling
19
+ when_to_use:
20
+ - AI is about to call any WoWok MCP tool
21
+ - AI is unsure which tool to use for a task
22
+ - AI encounters a tool error and needs to debug
23
+ - User asks "how do I..." for any WoWok operation
24
+ - AI needs exact schema for a specific operation_type or query_type
25
+ always: true
26
+ ---
27
+
28
+ # WoWok MCP Tool Usage Reference
29
+
30
+ ## The 13 Tools
31
+
32
+ | # | Tool | Type | Description |
33
+ |---|------|------|-------------|
34
+ | 1 | `onchain_operations` | Write | All on-chain state changes (16 operation_types) |
35
+ | 2 | `query_toolkit` | Read | Local + on-chain data query (8 query_types) |
36
+ | 3 | `onchain_table_data` | Read | Dynamic field/table sub-item queries (12 query_types) |
37
+ | 4 | `account_operation` | Local | Wallet management — 100% local |
38
+ | 5 | `local_mark_operation` | Local | Name→address mappings — 100% local |
39
+ | 6 | `local_info_operation` | Local | Private data store — 100% local |
40
+ | 7 | `messenger_operation` | Hybrid | Encrypted messaging (local + on-chain) |
41
+ | 8 | `wip_file` | Hybrid | Witness promise files (generate/verify/sign) |
42
+ | 9 | `guard2file` | Read | Export Guard definition to local file |
43
+ | 10 | `machineNode2file` | Read | Export Machine nodes to local file |
44
+ | 11 | `onchain_events` | Read | Watch on-chain events (paginated) |
45
+ | 12 | `wowok_buildin_info` | Read | Protocol reference (constants/instructions) |
46
+ | 13 | `documents_and_learn` | Read | Documentation URLs |
47
+
48
+ ---
49
+
50
+ ## 1. onchain_operations — On-Chain State Changes
51
+
52
+ **MCP Input**: `{ operation_type: string, data: object, submission?: object, env?: object }`
53
+
54
+ ### operation_type Discriminated Union (16 types)
55
+
56
+ The `operation_type` field determines WHICH `data` schema applies. Each type has a COMPLETELY different `data` structure.
57
+
58
+ #### service — Service Listing
59
+
60
+ ```typescript
61
+ // operation_type: "service"
62
+ data: {
63
+ object: TypedPermissionObject; // STRING for existing, OBJECT {name, permission, tags, type_parameter} for new
64
+ description?: string;
65
+ location?: string;
66
+ sales?: {
67
+ op: "add" | "set";
68
+ sales: { name: string; price: number; stock: number; suspension: boolean; wip: string; wip_hash: string }[];
69
+ } | { op: "remove"; sales_name: string[] } | { op: "clear" };
70
+ repositories?: ObjectsOp;
71
+ rewards?: ObjectsOp;
72
+ arbitrations?: ObjectsOp;
73
+ machine?: string | null;
74
+ discount?: { name: string; discount_type: 0 | 1; discount_value: number; benchmark?: number; time_ms_start?: number; time_ms_end?: number; count?: number; recipient: ManyAccountOrMark_Address; transferable?: boolean };
75
+ discount_destroy?: string[];
76
+ customer_required?: string[];
77
+ order_allocators?: { description: string; threshold: number; allocators: { guard: string; sharing: { who: Recipient; sharing: number; mode: "Amount" | "Rate" | "Surplus" }[]; fix?: number; max?: number }[] } | null;
78
+ buy_guard?: string | null;
79
+ change_guard?: string | null;
80
+ pause?: boolean;
81
+ publish?: boolean;
82
+ owner_receive?: ReceivedObjectsOrRecently;
83
+ um?: string | null;
84
+ }
85
+ ```
86
+
87
+ Key rules:
88
+ - `publish: true` LOCKS `machine` reference and `order_allocators` — unchangeable after publish
89
+ - `rewards` and `arbitrations` can be ADDED after publish, not removed
90
+ - `sales`, `discount`, `description`, `location` remain mutable after publish
91
+
92
+ #### machine — Workflow Template
93
+
94
+ ```typescript
95
+ // operation_type: "machine"
96
+ data: {
97
+ object: WithPermissionObject; // STRING for existing, OBJECT for new
98
+ progress_new?: ProgressNewSchema;
99
+ description?: string;
100
+ repository?: ObjectsSchema;
101
+ node?: NodeFieldSchema; // { op: "add"|"set"|"remove"|"clear"|"exchange"|"rename", nodes: [...], bReplace?: boolean } OR { json_or_markdown_file: "path" }
102
+ pause?: boolean;
103
+ publish?: boolean;
104
+ owner_receive?: ReceivedObjectsOrRecently;
105
+ um?: string | null;
106
+ }
107
+ ```
108
+
109
+ Key rules:
110
+ - `publish: true` makes node definitions IMMUTABLE
111
+ - `node` supports incremental ops (add/set/remove/clear/exchange/rename/remove_prior_node/add_forward/remove_forward) OR complete replacement from file
112
+ - Machine must be created BEFORE Service references it
113
+
114
+ #### progress — Workflow Advancement
115
+
116
+ ```typescript
117
+ // operation_type: "progress"
118
+ data: {
119
+ object: NameOrAddress; // Progress object ID
120
+ order: NameOrAddress;
121
+
122
+ // Advance mode
123
+ node?: { name: string; forward: number | string; hold?: boolean };
124
+ nodes?: { name: string; forward: number | string; hold?: boolean }[]; // Multi-step advance
125
+
126
+ // Admin control
127
+ admin_hold?: boolean;
128
+ admin_unhold?: boolean;
129
+ admin_unhold_node?: number;
130
+
131
+ // Acceptance
132
+ accept?: boolean;
133
+ recipient_accept?: NameOrAddress;
134
+
135
+ owner_receive?: ReceivedObjectsOrRecently;
136
+ um?: string | null;
137
+ }
138
+ ```
139
+
140
+ #### repository — Consensus Data
141
+
142
+ ```typescript
143
+ // operation_type: "repository"
144
+ data: {
145
+ object: WithPermissionObject;
146
+ description?: string;
147
+ entity?: string | NameOrAddress | null;
148
+
149
+ // Submit records
150
+ submit?: { op: "add" | "set" | "remove" | "clear"; records?: { address?: string; record: { timestamp: number; identifier: number; name?: string; description?: string; link?: string; linkPrototype?: string }; sign_buf?: number[]; sign_key_type?: string }[]; names?: string[] };
151
+ // Submit & sign records
152
+ submit_and_sign?: { op: "add" | "set" | "remove" | ...; records?: { ...; sign_buf?: number[] }[]; names?: string[] };
153
+ // Verify records
154
+ verify?: { records: { name: string }[]; verify_for_self?: boolean };
155
+ // Vote on records
156
+ vote?: { op: "add"; records?: { name: string; entity?: string }[] };
157
+
158
+ owner_receive?: ReceivedObjectsOrRecently;
159
+ um?: string | null;
160
+ }
161
+ ```
162
+
163
+ #### arbitration — Dispute Resolution
164
+
165
+ ```typescript
166
+ // operation_type: "arbitration"
167
+ data: {
168
+ object: WithPermissionObject;
169
+ description?: string;
170
+ entity?: string | NameOrAddress | null;
171
+
172
+ // Arbitrators
173
+ arbitrators?: { op: "add" | "set" | "remove" | "clear"; accounts?: ManyAccountOrMark_Address[]; accounts_remove?: string[] };
174
+
175
+ owner_receive?: ReceivedObjectsOrRecently;
176
+ um?: string | null;
177
+ }
178
+ ```
179
+
180
+ #### contact — IM Contact Profile
181
+
182
+ ```typescript
183
+ // operation_type: "contact"
184
+ data: {
185
+ object: WithPermissionObject;
186
+ my_status?: string;
187
+ description?: string;
188
+ location?: string;
189
+
190
+ ims?: { op: "add" | "set"; im: { at: string; description?: string }[] }
191
+ | { op: "remove"; im: string[] }
192
+ | { op: "clear" };
193
+
194
+ owner_receive?: ReceivedObjectsOrRecently;
195
+ }
196
+ ```
197
+
198
+ #### treasury — Team Fund
199
+
200
+ ```typescript
201
+ // operation_type: "treasury"
202
+ data: {
203
+ object: TypedPermissionObject;
204
+ description?: string;
205
+ receive?: ReceivedBalanceOrRecently;
206
+
207
+ deposit?: { coin: CoinParam; by_external_deposit_guard?: string; payment_info: { remark?: string; index?: number }; namedNewPayment?: NamedObject };
208
+ withdraw?: { amount: { fixed: number } | { by_external_withdraw_guard: string }; recipient: AccountOrMark_Address; payment_info: { remark?: string; index?: number }; namedNewPayment?: NamedObject };
209
+
210
+ external_deposit_guard?: { op: "add" | "set"; guards: { guard: string; identifier?: number | null; store_from_id?: number | null }[] }
211
+ | { op: "remove"; guards: string[] }
212
+ | { op: "clear" };
213
+ external_withdraw_guard?: { op: "add" | "set"; guards: { guard: string; identifier?: number | null; store_from_id?: number | null }[] }
214
+ | { op: "remove"; guards: string[] }
215
+ | { op: "clear" };
216
+
217
+ owner_receive?: ReceivedObjectsOrRecently;
218
+ um?: string | null;
219
+ }
220
+ ```
221
+
222
+ #### reward — Incentive Pool
223
+
224
+ ```typescript
225
+ // operation_type: "reward"
226
+ data: {
227
+ object: TypedPermissionObject;
228
+ claim?: string; // Guard ID — verify and trigger reward
229
+ description?: string;
230
+ coin_add?: CoinParam;
231
+ receive?: ReceivedBalanceOrRecently;
232
+
233
+ guard_add?: { guard: string; recipient: Recipient; amount: { type: "GuardU64Identifier"; value: number } | { type: "Fixed"; value: number }; expiration_time?: number; store_from_id?: number | null }[];
234
+ guard_remove_expired?: boolean;
235
+ guard_expiration_time?: number | null;
236
+
237
+ owner_receive?: ReceivedObjectsOrRecently;
238
+ um?: string | null;
239
+ }
240
+ ```
241
+
242
+ #### allocation — Auto-Distribution
243
+
244
+ ALLOCATION HAS TWO MODES discriminated by object format:
245
+
246
+ ```typescript
247
+ // MODE 1: CREATE new Allocation
248
+ data: {
249
+ object: { name?: string; tags?: string[]; onChain?: boolean; replaceExistName?: boolean; type_parameter?: string };
250
+ allocators: { description: string; threshold: number; allocators: { guard: string; sharing: { who: Recipient; sharing: number; mode: "Amount" | "Rate" | "Surplus" }[]; fix?: number; max?: number | null }[] };
251
+ coin: CoinParam;
252
+ payment_info: { remark?: string; index?: number };
253
+ }
254
+
255
+ // MODE 2: OPERATE existing Allocation
256
+ data: {
257
+ object: string; // Allocation ID or name
258
+ received_coins?: ReceivedBalanceOrRecently;
259
+ alloc_by_guard?: string;
260
+ }
261
+ ```
262
+
263
+ #### permission — Access Control
264
+
265
+ ```typescript
266
+ // operation_type: "permission"
267
+ data: {
268
+ object: WithPermissionObject;
269
+ description?: string;
270
+
271
+ // Write Guard policies
272
+ policy_add?: { who: AccountOrMark_Address; guard: string; store_from_id?: number | null }[];
273
+ policy_remove?: { who: AccountOrMark_Address }[];
274
+ policy_clear?: boolean;
275
+
276
+ owner_receive?: ReceivedObjectsOrRecently;
277
+ um?: string | null;
278
+ }
279
+ ```
280
+
281
+ #### guard — Programmable Validation
282
+
283
+ ```typescript
284
+ // operation_type: "guard"
285
+ data: {
286
+ namedNew?: NamedObject;
287
+ description?: string;
288
+
289
+ table?: { identifier: number; b_submission: boolean; value_type: ValueType; value?: SupportedValue; name?: string }[];
290
+
291
+ root: { type: "node"; node: GuardNode } | { type: "file"; file_path: string; format?: "json" | "markdown" };
292
+
293
+ rely?: { guards: string[]; logic_or?: boolean };
294
+ }
295
+ ```
296
+
297
+ GuardNode types (70+ variants, see wowok-guard skill for complete reference):
298
+ - Logic: `logic_and`, `logic_or`, `logic_not`, `logic_equal`, `logic_string_contains`, `logic_string_nocase_contains`, `logic_string_nocase_equal`, `logic_as_u256_equal`, `logic_as_u256_greater`, `logic_as_u256_lesser`, `logic_as_u256_greater_or_equal`, `logic_as_u256_lesser_or_equal`
299
+ - Arithmetic: `calc_number_add`, `calc_number_subtract`, `calc_number_multiply`, `calc_number_divide`, `calc_number_mod`, `calc_string_length`, `calc_string_contains`, `calc_string_nocase_contains`, `calc_string_nocase_equal`, `calc_string_indexof`, `calc_string_nocase_indexof`
300
+ - Conversion: `convert_number_address`, `convert_address_number`, `convert_number_string`, `convert_string_number`, `convert_safe_u8`..`convert_safe_u256`
301
+ - Vector: `vec_length`, `vec_contains_bool`, `vec_contains_address`, `vec_contains_string`, `vec_contains_string_nocase`, `vec_contains_number`, `vec_indexof_bool`, `vec_indexof_address`, `vec_indexof_string`, `vec_indexof_string_nocase`, `vec_indexof_number`
302
+ - Records: `record_check_recipient_order`, `record_check_recipient_progress`, `record_check_recipient_reward`, `record_check_treasury_history_item`, `record_check_progress_history_item`, and more
303
+ - Special: `query`, `identifier`, `value_type`
304
+
305
+ #### personal — On-Chain Public Identity
306
+
307
+ ```typescript
308
+ // operation_type: "personal"
309
+ data: {
310
+ description?: string;
311
+ referrer?: string | AccountOrMark_Address | null;
312
+
313
+ information?: { op: "add"; data: { name: string; value_type: ValueType; value: SupportedValue }[] }
314
+ | { op: "remove"; name: string[] }
315
+ | { op: "clear" };
316
+
317
+ mark?: { op: "add"; data: { address: string; name?: string; tags?: string[] }[] }
318
+ | { op: "remove"; data: { address: string; tags?: string[] }[] }
319
+ | { op: "clear"; address: ManyAccountOrMark_Address }
320
+ | { op: "transfer"; to: AccountOrMark_Address }
321
+ | { op: "replace"; new_mark_object: string }
322
+ | { op: "destroy" };
323
+ }
324
+ ```
325
+
326
+ ⚠️ CRITICAL: Everything in `personal` is PERMANENTLY PUBLIC on-chain.
327
+
328
+ #### payment — Irreversible Coin Transfer
329
+
330
+ ```typescript
331
+ // operation_type: "payment"
332
+ data: {
333
+ object: { name?: string; tags?: string[]; onChain?: boolean; replaceExistName?: boolean; type_parameter?: string };
334
+ revenue: { recipient: AccountOrMark_Address; amount: CoinParam }[];
335
+ info: { remark?: string; index?: number };
336
+ }
337
+ ```
338
+
339
+ ⚠️ CRITICAL: Payment is IRREVERSIBLE. Always confirm recipient, amount, and token type before executing.
340
+
341
+ #### demand — Service Request
342
+
343
+ ```typescript
344
+ // operation_type: "demand"
345
+ data: {
346
+ object: WithPermissionObject;
347
+ present?: { recommend: string; by_guard?: string; service?: string };
348
+ description?: string;
349
+ location?: string;
350
+ rewards?: ObjectsOp;
351
+
352
+ guards?: { op: "add" | "set"; guard: { guard: string; service_identifier?: number | null }[] }
353
+ | { op: "remove"; guard: string[] }
354
+ | { op: "clear" };
355
+
356
+ feedback?: { who: AccountOrMark_Address; acceptance_score?: number; feedback?: string }[];
357
+ owner_receive?: ReceivedObjectsOrRecently;
358
+ um?: string | null;
359
+ }
360
+ ```
361
+
362
+ #### order — Order Lifecycle
363
+
364
+ ```typescript
365
+ // operation_type: "order"
366
+ data: {
367
+ object: string | NameOrAddress; // Order ID or name (required)
368
+
369
+ agents?: ManyAccountOrMark_Address;
370
+ required_info?: string | null;
371
+
372
+ progress?: { operation: { next_node_name: string; forward: string }; hold?: boolean; adminUnhold?: boolean; message?: string };
373
+
374
+ arb_confirm?: { arb: string; confirm: boolean; description?: string; proposition?: string[] };
375
+ arb_objection?: { arb: string; objection: string };
376
+ arb_claim_compensation?: { arb: string };
377
+
378
+ receive?: QueryReceivedResult;
379
+ transfer_to?: AccountOrMark_Address;
380
+ }
381
+ ```
382
+
383
+ #### gen_passport — Immutable Credential
384
+
385
+ ```typescript
386
+ // operation_type: "gen_passport"
387
+ data: {
388
+ guard: string | string[]; // Guard object ID(s) to verify. Can be a single guard or an array of guards.
389
+ info?: SubmissionCall;
390
+ }
391
+ ```
392
+
393
+ **Features:**
394
+ - **Single Guard**: Pass a single guard ID or name as a string
395
+ - **Multiple Guards**: Pass an array of guard IDs or names to verify multiple guards at once
396
+ - **Name Resolution**: Supports both guard addresses and LocalMark names
397
+
398
+ ### Common Sub-Types
399
+
400
+ **TypedPermissionObject**: STRING (existing) or OBJECT `{ name, permission, tags?, onChain?, replaceExistName?, type_parameter? }`
401
+
402
+ **WithPermissionObject**: Same as TypedPermissionObject but WITHOUT `type_parameter`
403
+
404
+ **SubmissionCall** (for execution):
405
+ ```typescript
406
+ {
407
+ sender: string;
408
+ gas_budget: string;
409
+ // additional network/execution params
410
+ }
411
+ ```
412
+
413
+ **CoinParam**: `number` (raw) or `string` (e.g., "2WOW", "100USDT")
414
+ **NamedObject**: `{ name: string; tags?: string[]; onChain?: boolean; replaceExistName?: boolean }`
415
+
416
+ ---
417
+
418
+ ## 2. query_toolkit — Data Query
419
+
420
+ **MCP Input**: `{ query_type: string, ... }` — discriminated union
421
+
422
+ ### 8 query_types
423
+
424
+ #### local_mark_list
425
+ ```typescript
426
+ { query_type: "local_mark_list"; network?: string }
427
+ ```
428
+ Returns: list of local name→address mappings
429
+
430
+ #### account_list
431
+ ```typescript
432
+ { query_type: "account_list" }
433
+ ```
434
+ Returns: list of local accounts
435
+
436
+ #### local_info_list
437
+ ```typescript
438
+ { query_type: "local_info_list"; network?: string }
439
+ ```
440
+ Returns: local private data entries
441
+
442
+ #### token_list
443
+ ```typescript
444
+ { query_type: "token_list"; network?: string }
445
+ ```
446
+ Returns: available token types with precision info
447
+
448
+ #### account_balance
449
+ ```typescript
450
+ { query_type: "account_balance"; address: string; token_type?: string; network?: string }
451
+ ```
452
+ Returns: account token balance
453
+
454
+ #### onchain_personal_profile
455
+ ```typescript
456
+ { query_type: "onchain_personal_profile"; address: string; network?: string; no_cache?: boolean }
457
+ ```
458
+ Returns: on-chain public profile
459
+
460
+ #### onchain_objects
461
+ ```typescript
462
+ { query_type: "onchain_objects"; address?: string; name_or_address?: string; network?: string; no_cache?: boolean }
463
+ ```
464
+ Returns: on-chain objects owned by address
465
+
466
+ #### onchain_received
467
+ ```typescript
468
+ { query_type: "onchain_received"; name_or_address: string | AccountOrMark_Address; all_type?: boolean; cursor?: string | null; limit?: number | null; no_cache?: boolean; network?: string }
469
+ ```
470
+ Returns: received CoinWrapper objects
471
+
472
+ ---
473
+
474
+ ## 3. onchain_table_data — Table Sub-Items
475
+
476
+ **MCP Input**: `{ query_type: string, parent: string, ... }` — 12 query_types
477
+
478
+ | query_type | Parent | Key | Returns |
479
+ |------------|--------|-----|---------|
480
+ | `onchain_table` | any object | — (paginated cursor) | TableAnswer |
481
+ | `onchain_table_item_repository_data` | Repository | name + entity | entry record |
482
+ | `onchain_table_item_permission_perm` | Permission | address | perm entry |
483
+ | `onchain_table_item_entity_registrar` | Registrar | address | registrar record |
484
+ | `onchain_table_item_entity_linker` | Linker | entity + who | linker entry |
485
+ | `onchain_table_item_reward_record` | Reward | address | claim record |
486
+ | `onchain_table_item_demand_presenter` | Demand | address | presenter info |
487
+ | `onchain_table_item_treasury_history` | Treasury | address (payment) | history entry |
488
+ | `onchain_table_item_machine_node` | Machine | u64 (index) | node definition |
489
+ | `onchain_table_item_progress_history` | Progress | u64 (index) | history entry |
490
+ | `onchain_table_item_address_mark` | AddressMark | address | public mark |
491
+ | `onchain_table_item_generic` | any object | key_type + key_value | ObjectBase |
492
+
493
+ All support: `no_cache?: boolean`, `network?: "localnet" | "testnet"`
494
+
495
+ ---
496
+
497
+ ## 4. account_operation — LOCAL Wallet
498
+
499
+ **MCP Input**: `{ operation_type: string, data: object }`
500
+
501
+ Operations: `generate`, `suspend`, `resume`, `faucet`, `sign`, `signData`, `query`
502
+
503
+ 100% LOCAL — never touches blockchain.
504
+
505
+ ---
506
+
507
+ ## 5. local_mark_operation — LOCAL Address Book
508
+
509
+ **MCP Input**: `{ operation_type: string, data: object }`
510
+
511
+ ```typescript
512
+ // Add marks
513
+ { operation_type: "add", data: { marks: { name: string; address: string; tags?: string[] }[], network?: string } }
514
+
515
+ // Remove marks
516
+ { operation_type: "remove", data: { marks: { name: string }[]; network?: string } }
517
+
518
+ // Clear all
519
+ { operation_type: "clear", data: { network?: string } }
520
+ ```
521
+
522
+ ---
523
+
524
+ ## 6. local_info_operation — LOCAL Private Data
525
+
526
+ **MCP Input**: `{ operation_type: string, data: object }`
527
+
528
+ Store sensitive info (phone, address, contacts) locally.
529
+
530
+ ---
531
+
532
+ ## 7. messenger_operation — Encrypted Messaging
533
+
534
+ **MCP Input**: varies by operation
535
+
536
+ Operations: `watch_conversations`, `send_message`, `send_file`, `watch_messages`, `extract_zip_messages`, `generate_wts`, `verify_wts`, `sign_wts`, `wts2html`, `proof_message`, `mark_messages_as_viewed`, `mark_conversation_as_viewed`, `blacklist`, `friendslist`, `guardlist`, `settings`
537
+
538
+ ---
539
+
540
+ ## 8-13 Quick Reference
541
+
542
+ - **wip_file**: `{ operation: "generate"|"verify"|"sign"|"wip2html", data: object }`
543
+ - **guard2file**: `{ guard: string; file_path: string; format?: "json"|"markdown" }`
544
+ - **machineNode2file**: `{ machine: string; file_path: string; format?: "json"|"markdown" }`
545
+ - **onchain_events**: `{ type: string; cursor?: string | null; limit?: number | null }`
546
+ - **wowok_buildin_info**: `{ info_type: "constants"|"permissions"|"guard_instructions"|"network"|"value_types" }`
547
+ - **documents_and_learn**: `{ document_type?: string }`
548
+
549
+ ---
550
+
551
+ ## Tool Selection Decision Tree
552
+
553
+ ```
554
+ User wants to...
555
+ ├─ CREATE/MODIFY on-chain object → onchain_operations
556
+ │ ├─ operation_type = service | machine | permission | guard | ...
557
+ │ └─ data = { op: "create"|"update"|..., ... }
558
+
559
+ ├─ QUERY data
560
+ │ ├─ Local accounts/marks/info/tokens → query_toolkit
561
+ │ ├─ On-chain objects/profile → query_toolkit (onchain_objects / onchain_personal_profile)
562
+ │ ├─ Account balance → query_toolkit (account_balance)
563
+ │ ├─ Table sub-items → onchain_table_data
564
+ │ ├─ Received payments → query_toolkit (onchain_received)
565
+ │ └─ On-chain events → onchain_events
566
+
567
+ ├─ MANAGE local data
568
+ │ ├─ Accounts → account_operation
569
+ │ ├─ Address book → local_mark_operation
570
+ │ └─ Private info → local_info_operation
571
+
572
+ ├─ COMMUNICATE → messenger_operation
573
+ ├─ PROMISES (WIP) → wip_file
574
+ ├─ EXPORT definitions → guard2file / machineNode2file
575
+ ├─ LEARN protocol → wowok_buildin_info
576
+ └─ DOCUMENTATION → documents_and_learn
577
+ ```
578
+
579
+ ---
580
+
581
+ ## Mandatory Patterns
582
+
583
+ ### Query-First Pattern (ALWAYS before writes)
584
+
585
+ ```
586
+ 1. query_toolkit (account_list) → Which accounts exist?
587
+ 2. query_toolkit (local_mark_list) → What named addresses exist?
588
+ 3. query_toolkit (onchain_objects) → What's already on-chain?
589
+ 4. wowok_buildin_info → Protocol constants/permissions
590
+ ```
591
+
592
+ ### Dry-Run Pattern (ALWAYS for writes)
593
+
594
+ ```
595
+ 1. Call onchain_operations WITHOUT submission → Validate + Preview
596
+ 2. Show preview to user → Get explicit confirmation
597
+ 3. Call onchain_operations WITH submission → Execute
598
+ ```
599
+
600
+ ---
601
+
602
+ ## Common Errors
603
+
604
+ | Error | Cause | Fix |
605
+ |-------|-------|-----|
606
+ | "object not found" | Cache stale | Add `no_cache: true` |
607
+ | "permission denied" | Wrong sender | Verify sender has permission |
608
+ | "unknown query_type" | Wrong tool | Check if table query → use `onchain_table_data` |
609
+ | "table field required" | Missing Guard table | Guards MUST have `table` array |
610
+ | "dependency not found" | Build order | Build dependencies before dependents |
611
+ | "invalid parameter" | Wrong format | Check discriminated union branch |
612
+ | submission parameter errors | Didn't check schema | Verify all submission fields |
613
+
614
+ ---
615
+
616
+ ## Bundled Schema Reference
617
+
618
+ When MCP tool schemas are unavailable or ambiguous, consult the complete schema files bundled with this package. Each file contains the full discriminated union, all nested sub-fields, and exact type definitions.
619
+
620
+ | Tool | Schema File | Contents |
621
+ |------|-----------|----------|
622
+ | `onchain_operations` | [schemas/onchain_operations/](../schemas/onchain_operations/) | 16 types split by operation_type. [_index.md](../schemas/onchain_operations/_index.md) for lookup, [_common.md](../schemas/onchain_operations/_common.md) for shared CallEnv/SubmissionCall/ValueTypes |
623
+ | `query_toolkit` | [schemas/schema-query_toolkit.md](../schemas/schema-query_toolkit.md) | 8 query_types, pagination params, filter structures |
624
+ | `onchain_table_data` | [schemas/schema-onchain_table_data.md](../schemas/schema-onchain_table_data.md) | 12 query_types, parent/key structures, result schemas |
625
+ | `onchain_events` | [schemas/schema-onchain_events.md](../schemas/schema-onchain_events.md) | Event query types, pagination |
626
+ | `account_operation` | [schemas/schema-account_operation.md](../schemas/schema-account_operation.md) | Local wallet operations (generate, sign, faucet, etc.) |
627
+ | `local_mark_operation` | [schemas/schema-local_mark_operation.md](../schemas/schema-local_mark_operation.md) | Address book mark operations |
628
+ | `local_info_operation` | [schemas/schema-local_info_operation.md](../schemas/schema-local_info_operation.md) | Private local data operations |
629
+ | `messenger_operation` | [schemas/schema-messenger_operation.md](../schemas/schema-messenger_operation.md) | Encrypted messaging operations |
630
+ | `wip_file` | [schemas/schema-wip_file.md](../schemas/schema-wip_file.md) | Witness promise file operations |
631
+ | `guard2file` | [schemas/schema-guard2file.md](../schemas/schema-guard2file.md) | Guard export to file |
632
+ | `machineNode2file` | [schemas/schema-machineNode2file.md](../schemas/schema-machineNode2file.md) | Machine nodes export to file |
633
+ | `wowok_buildin_info` | [schemas/schema-wowok_buildin_info.md](../schemas/schema-wowok_buildin_info.md) | Protocol constants, permissions, guard instructions |
634
+
635
+ **When to use**: Always verify the schema before calling complex tools like `onchain_operations` — the discriminated union has 16 branches with 5-6 levels of nesting, and one wrong field name causes immediate failure.