@mcp-dockmaster/mcp-cryptowallet-evm 1.0.0

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.
@@ -0,0 +1,16 @@
1
+ export type fromPrivateKeyHandlerInput = {
2
+ privateKey: string;
3
+ provider?: string;
4
+ };
5
+
6
+ export type createMnemonicPhraseHandlerInput = {
7
+ locale?: string;
8
+ length?: 12 | 15 | 18 | 21 | 24;
9
+ };
10
+
11
+ export type fromMnemonicHandlerInput = {
12
+ mnemonic: string;
13
+ provider?: string;
14
+ path?: string;
15
+ locale?: string;
16
+ };
package/src/index.ts ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import {
6
+ CallToolRequestSchema,
7
+ ErrorCode,
8
+ ListToolsRequestSchema,
9
+ McpError,
10
+ } from "@modelcontextprotocol/sdk/types.js";
11
+ import { handlers, tools } from "./tools.js";
12
+
13
+ const server = new Server({
14
+ name: "mcp-cryptowallet-evm",
15
+ version: "1.0.0",
16
+ }, {
17
+ capabilities: {
18
+ tools: {}
19
+ }
20
+ });
21
+
22
+ const transport = new StdioServerTransport();
23
+ await server.connect(transport);
24
+
25
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
26
+ return { tools };
27
+ });
28
+
29
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
30
+ const handler = handlers[request.params.name];
31
+ if (handler) {
32
+ try {
33
+ const input = request.params.arguments;
34
+ return await handler(input);
35
+ } catch (error) {
36
+ return { toolResult: { error: (error as Error).message }, content: [], isError: true };
37
+ }
38
+ }
39
+ return { toolResult: { error: "Method not found" }, content: [], isError: true };
40
+ });
package/src/tools.ts ADDED
@@ -0,0 +1,621 @@
1
+ import {
2
+ createWalletHandler,
3
+ fromPrivateKeyHandler,
4
+ fromMnemonicHandler,
5
+ fromEncryptedJsonHandler,
6
+ encryptWalletHandler,
7
+ getAddressHandler,
8
+ getPublicKeyHandler,
9
+ getPrivateKeyHandler,
10
+ getBalanceHandler,
11
+ getChainIdHandler,
12
+ getGasPriceHandler,
13
+ getTransactionCountHandler,
14
+ callHandler,
15
+ sendTransactionHandler,
16
+ signTransactionHandler,
17
+ populateTransactionHandler,
18
+ signMessageHandler,
19
+ signTypedDataHandler,
20
+ verifyMessageHandler,
21
+ verifyTypedDataHandler,
22
+ getBlockHandler,
23
+ getTransactionHandler,
24
+ getTransactionReceiptHandler,
25
+ getCodeHandler,
26
+ getStorageAtHandler,
27
+ estimateGasHandler,
28
+ getLogsHandler,
29
+ getEnsResolverHandler,
30
+ lookupAddressHandler,
31
+ resolveNameHandler,
32
+ getNetworkHandler,
33
+ getBlockNumberHandler,
34
+ getFeeDataHandler,
35
+ createMnemonicPhraseHandler
36
+ } from "./handlers/wallet.js";
37
+
38
+ export const tools = [
39
+ // Wallet Creation and Management
40
+ {
41
+ name: "wallet_create_random",
42
+ description: "Create a new wallet with a random private key",
43
+ inputSchema: {
44
+ type: "object",
45
+ properties: {
46
+ password: { type: "string", description: "Optional password to encrypt the wallet" },
47
+ path: { type: "string", description: "Optional HD path" },
48
+ locale: { type: "string", description: "Optional locale for the wordlist" }
49
+ },
50
+ required: []
51
+ }
52
+ },
53
+ {
54
+ name: "wallet_from_private_key",
55
+ description: "Create a wallet from a private key",
56
+ inputSchema: {
57
+ type: "object",
58
+ properties: {
59
+ privateKey: { type: "string", description: "The private key" },
60
+ provider: { type: "string", description: "Optional JSON RPC provider URL" }
61
+ },
62
+ required: ["privateKey"]
63
+ }
64
+ },
65
+ {
66
+ name: "wallet_create_mnemonic_phrase",
67
+ description: "Create a mnemonic phrase",
68
+ inputSchema: {
69
+ type: "object",
70
+ properties: {
71
+ length: { type: "number", description: "The length of the mnemonic phrase", enum: [12, 15, 18, 21, 24] },
72
+ locale: { type: "string", description: "Optional locale for the wordlist" }
73
+ },
74
+ required: ["length"]
75
+ }
76
+ },
77
+ {
78
+ name: "wallet_from_mnemonic",
79
+ description: "Create a wallet from a mnemonic phrase",
80
+ inputSchema: {
81
+ type: "object",
82
+ properties: {
83
+ mnemonic: { type: "string", description: "The mnemonic phrase" },
84
+ path: { type: "string", description: "Optional HD path" },
85
+ locale: { type: "string", description: "Optional locale for the wordlist" },
86
+ provider: { type: "string", description: "Optional JSON RPC provider URL" }
87
+ },
88
+ required: ["mnemonic"]
89
+ }
90
+ },
91
+ {
92
+ name: "wallet_from_encrypted_json",
93
+ description: "Create a wallet by decrypting an encrypted JSON wallet",
94
+ inputSchema: {
95
+ type: "object",
96
+ properties: {
97
+ json: { type: "string", description: "The encrypted JSON wallet" },
98
+ password: { type: "string", description: "The password to decrypt the wallet" },
99
+ provider: { type: "string", description: "Optional JSON RPC provider URL" }
100
+ },
101
+ required: ["json", "password"]
102
+ }
103
+ },
104
+ {
105
+ name: "wallet_encrypt",
106
+ description: "Encrypt a wallet with a password",
107
+ inputSchema: {
108
+ type: "object",
109
+ properties: {
110
+ wallet: { type: "string", description: "The wallet to encrypt (private key, mnemonic, or JSON)" },
111
+ password: { type: "string", description: "The password to encrypt the wallet" },
112
+ options: {
113
+ type: "object",
114
+ description: "Optional encryption options",
115
+ properties: {
116
+ scrypt: {
117
+ type: "object",
118
+ properties: {
119
+ N: { type: "number" },
120
+ r: { type: "number" },
121
+ p: { type: "number" }
122
+ }
123
+ }
124
+ }
125
+ }
126
+ },
127
+ required: ["wallet", "password"]
128
+ }
129
+ },
130
+
131
+ // Wallet Properties
132
+ {
133
+ name: "wallet_get_address",
134
+ description: "Get the wallet address",
135
+ inputSchema: {
136
+ type: "object",
137
+ properties: {
138
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" }
139
+ },
140
+ required: ["wallet"]
141
+ }
142
+ },
143
+ {
144
+ name: "wallet_get_public_key",
145
+ description: "Get the wallet public key",
146
+ inputSchema: {
147
+ type: "object",
148
+ properties: {
149
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" }
150
+ },
151
+ required: ["wallet"]
152
+ }
153
+ },
154
+ {
155
+ name: "wallet_get_private_key",
156
+ description: "Get the wallet private key (with appropriate security warnings)",
157
+ inputSchema: {
158
+ type: "object",
159
+ properties: {
160
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
161
+ password: { type: "string", description: "The password to decrypt the wallet if it's encrypted" }
162
+ },
163
+ required: ["wallet"]
164
+ }
165
+ },
166
+ // Blockchain Methods
167
+ {
168
+ name: "wallet_get_balance",
169
+ description: "Get the balance of the wallet",
170
+ inputSchema: {
171
+ type: "object",
172
+ properties: {
173
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
174
+ provider: { type: "string", description: "Optional JSON RPC provider URL" },
175
+ blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" }
176
+ },
177
+ required: ["wallet", "provider"]
178
+ }
179
+ },
180
+ {
181
+ name: "wallet_get_chain_id",
182
+ description: "Get the chain ID the wallet is connected to",
183
+ inputSchema: {
184
+ type: "object",
185
+ properties: {
186
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
187
+ provider: { type: "string", description: "Optional JSON RPC provider URL" }
188
+ },
189
+ required: ["wallet"]
190
+ }
191
+ },
192
+ {
193
+ name: "wallet_get_gas_price",
194
+ description: "Get the current gas price",
195
+ inputSchema: {
196
+ type: "object",
197
+ properties: {
198
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
199
+ provider: { type: "string", description: "Optional JSON RPC provider URL" }
200
+ },
201
+ required: ["wallet"]
202
+ }
203
+ },
204
+ {
205
+ name: "wallet_get_transaction_count",
206
+ description: "Get the number of transactions sent from this account (nonce)",
207
+ inputSchema: {
208
+ type: "object",
209
+ properties: {
210
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
211
+ provider: { type: "string", description: "Optional JSON RPC provider URL" },
212
+ blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" }
213
+ },
214
+ required: ["wallet"]
215
+ }
216
+ },
217
+ {
218
+ name: "wallet_call",
219
+ description: "Call a contract method without sending a transaction",
220
+ inputSchema: {
221
+ type: "object",
222
+ properties: {
223
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
224
+ provider: { type: "string", description: "Optional JSON RPC provider URL" },
225
+ transaction: {
226
+ type: "object",
227
+ description: "The transaction to call",
228
+ properties: {
229
+ to: { type: "string" },
230
+ from: { type: "string" },
231
+ data: { type: "string" },
232
+ value: { type: "string" },
233
+ gasLimit: { type: "string" },
234
+ gasPrice: { type: "string" }
235
+ },
236
+ required: ["to"]
237
+ },
238
+ blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" }
239
+ },
240
+ required: ["wallet", "transaction"]
241
+ }
242
+ },
243
+
244
+ // Transaction Methods
245
+ {
246
+ name: "wallet_send_transaction",
247
+ description: "Send a transaction",
248
+ inputSchema: {
249
+ type: "object",
250
+ properties: {
251
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
252
+ provider: { type: "string", description: "Optional JSON RPC provider URL" },
253
+ transaction: {
254
+ type: "object",
255
+ description: "The transaction to send",
256
+ properties: {
257
+ to: { type: "string" },
258
+ from: { type: "string" },
259
+ data: { type: "string" },
260
+ value: { type: "string" },
261
+ gasLimit: { type: "string" },
262
+ gasPrice: { type: "string" },
263
+ nonce: { type: "number" },
264
+ type: { type: "number" },
265
+ maxFeePerGas: { type: "string" },
266
+ maxPriorityFeePerGas: { type: "string" }
267
+ },
268
+ required: ["to"]
269
+ }
270
+ },
271
+ required: ["wallet", "transaction"]
272
+ }
273
+ },
274
+ {
275
+ name: "wallet_sign_transaction",
276
+ description: "Sign a transaction without sending it",
277
+ inputSchema: {
278
+ type: "object",
279
+ properties: {
280
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
281
+ provider: { type: "string", description: "Optional JSON RPC provider URL" },
282
+ transaction: {
283
+ type: "object",
284
+ description: "The transaction to sign",
285
+ properties: {
286
+ to: { type: "string" },
287
+ from: { type: "string" },
288
+ data: { type: "string" },
289
+ value: { type: "string" },
290
+ gasLimit: { type: "string" },
291
+ gasPrice: { type: "string" },
292
+ nonce: { type: "number" },
293
+ type: { type: "number" },
294
+ maxFeePerGas: { type: "string" },
295
+ maxPriorityFeePerGas: { type: "string" }
296
+ },
297
+ required: ["to"]
298
+ }
299
+ },
300
+ required: ["wallet", "transaction"]
301
+ }
302
+ },
303
+ {
304
+ name: "wallet_populate_transaction",
305
+ description: "Populate a transaction with missing fields",
306
+ inputSchema: {
307
+ type: "object",
308
+ properties: {
309
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
310
+ provider: { type: "string", description: "Optional JSON RPC provider URL" },
311
+ transaction: {
312
+ type: "object",
313
+ description: "The transaction to populate",
314
+ properties: {
315
+ to: { type: "string" },
316
+ from: { type: "string" },
317
+ data: { type: "string" },
318
+ value: { type: "string" },
319
+ gasLimit: { type: "string" },
320
+ gasPrice: { type: "string" },
321
+ nonce: { type: "number" },
322
+ type: { type: "number" },
323
+ maxFeePerGas: { type: "string" },
324
+ maxPriorityFeePerGas: { type: "string" }
325
+ },
326
+ required: ["to"]
327
+ }
328
+ },
329
+ required: ["wallet", "transaction"]
330
+ }
331
+ },
332
+
333
+ // Signing Methods
334
+ {
335
+ name: "wallet_sign_message",
336
+ description: "Sign a message",
337
+ inputSchema: {
338
+ type: "object",
339
+ properties: {
340
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
341
+ message: { type: "string", description: "The message to sign" }
342
+ },
343
+ required: ["wallet", "message"]
344
+ }
345
+ },
346
+ {
347
+ name: "wallet_sign_typed_data",
348
+ description: "Sign typed data (EIP-712)",
349
+ inputSchema: {
350
+ type: "object",
351
+ properties: {
352
+ wallet: { type: "string", description: "The wallet (private key, mnemonic, or JSON)" },
353
+ domain: { type: "object", description: "The domain data" },
354
+ types: { type: "object", description: "The type definitions" },
355
+ value: { type: "object", description: "The value to sign" }
356
+ },
357
+ required: ["wallet", "domain", "types", "value"]
358
+ }
359
+ },
360
+ {
361
+ name: "wallet_verify_message",
362
+ description: "Verify a signed message",
363
+ inputSchema: {
364
+ type: "object",
365
+ properties: {
366
+ message: { type: "string", description: "The original message" },
367
+ signature: { type: "string", description: "The signature to verify" },
368
+ address: { type: "string", description: "The address that supposedly signed the message" }
369
+ },
370
+ required: ["message", "signature", "address"]
371
+ }
372
+ },
373
+ {
374
+ name: "wallet_verify_typed_data",
375
+ description: "Verify signed typed data",
376
+ inputSchema: {
377
+ type: "object",
378
+ properties: {
379
+ domain: { type: "object", description: "The domain data" },
380
+ types: { type: "object", description: "The type definitions" },
381
+ value: { type: "object", description: "The value that was signed" },
382
+ signature: { type: "string", description: "The signature to verify" },
383
+ address: { type: "string", description: "The address that supposedly signed the data" }
384
+ },
385
+ required: ["domain", "types", "value", "signature", "address"]
386
+ }
387
+ },
388
+
389
+ // Provider Methods
390
+ {
391
+ name: "provider_get_block",
392
+ description: "Get a block by number or hash",
393
+ inputSchema: {
394
+ type: "object",
395
+ properties: {
396
+ provider: { type: "string", description: "JSON RPC provider URL" },
397
+ blockHashOrBlockTag: { type: "string", description: "Block hash or block tag (latest, pending, etc.)" },
398
+ includeTransactions: { type: "boolean", description: "Whether to include full transactions or just hashes" }
399
+ },
400
+ required: ["provider", "blockHashOrBlockTag"]
401
+ }
402
+ },
403
+ {
404
+ name: "provider_get_transaction",
405
+ description: "Get a transaction by hash",
406
+ inputSchema: {
407
+ type: "object",
408
+ properties: {
409
+ provider: { type: "string", description: "JSON RPC provider URL" },
410
+ transactionHash: { type: "string", description: "The transaction hash" }
411
+ },
412
+ required: ["provider", "transactionHash"]
413
+ }
414
+ },
415
+ {
416
+ name: "provider_get_transaction_receipt",
417
+ description: "Get a transaction receipt",
418
+ inputSchema: {
419
+ type: "object",
420
+ properties: {
421
+ provider: { type: "string", description: "JSON RPC provider URL" },
422
+ transactionHash: { type: "string", description: "The transaction hash" }
423
+ },
424
+ required: ["provider", "transactionHash"]
425
+ }
426
+ },
427
+ {
428
+ name: "provider_get_code",
429
+ description: "Get the code at an address",
430
+ inputSchema: {
431
+ type: "object",
432
+ properties: {
433
+ provider: { type: "string", description: "JSON RPC provider URL" },
434
+ address: { type: "string", description: "The address to get code from" },
435
+ blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" }
436
+ },
437
+ required: ["provider", "address"]
438
+ }
439
+ },
440
+ {
441
+ name: "provider_get_storage_at",
442
+ description: "Get the storage at a position for an address",
443
+ inputSchema: {
444
+ type: "object",
445
+ properties: {
446
+ provider: { type: "string", description: "JSON RPC provider URL" },
447
+ address: { type: "string", description: "The address to get storage from" },
448
+ position: { type: "string", description: "The storage position" },
449
+ blockTag: { type: "string", description: "Optional block tag (latest, pending, etc.)" }
450
+ },
451
+ required: ["provider", "address", "position"]
452
+ }
453
+ },
454
+ {
455
+ name: "provider_estimate_gas",
456
+ description: "Estimate the gas required for a transaction",
457
+ inputSchema: {
458
+ type: "object",
459
+ properties: {
460
+ provider: { type: "string", description: "JSON RPC provider URL" },
461
+ transaction: {
462
+ type: "object",
463
+ description: "The transaction to estimate gas for",
464
+ properties: {
465
+ to: { type: "string" },
466
+ from: { type: "string" },
467
+ data: { type: "string" },
468
+ value: { type: "string" }
469
+ }
470
+ }
471
+ },
472
+ required: ["provider", "transaction"]
473
+ }
474
+ },
475
+ {
476
+ name: "provider_get_logs",
477
+ description: "Get logs that match a filter",
478
+ inputSchema: {
479
+ type: "object",
480
+ properties: {
481
+ provider: { type: "string", description: "JSON RPC provider URL" },
482
+ filter: {
483
+ type: "object",
484
+ description: "The filter to apply",
485
+ properties: {
486
+ address: { type: "string" },
487
+ topics: { type: "array", items: { type: "string" } },
488
+ fromBlock: { type: "string" },
489
+ toBlock: { type: "string" }
490
+ }
491
+ }
492
+ },
493
+ required: ["provider", "filter"]
494
+ }
495
+ },
496
+ {
497
+ name: "provider_get_ens_resolver",
498
+ description: "Get the ENS resolver for a name",
499
+ inputSchema: {
500
+ type: "object",
501
+ properties: {
502
+ provider: { type: "string", description: "JSON RPC provider URL" },
503
+ name: { type: "string", description: "The ENS name" }
504
+ },
505
+ required: ["provider", "name"]
506
+ }
507
+ },
508
+ {
509
+ name: "provider_lookup_address",
510
+ description: "Lookup the ENS name for an address",
511
+ inputSchema: {
512
+ type: "object",
513
+ properties: {
514
+ provider: { type: "string", description: "JSON RPC provider URL" },
515
+ address: { type: "string", description: "The address to lookup" }
516
+ },
517
+ required: ["provider", "address"]
518
+ }
519
+ },
520
+ {
521
+ name: "provider_resolve_name",
522
+ description: "Resolve an ENS name to an address",
523
+ inputSchema: {
524
+ type: "object",
525
+ properties: {
526
+ provider: { type: "string", description: "JSON RPC provider URL" },
527
+ name: { type: "string", description: "The ENS name to resolve" }
528
+ },
529
+ required: ["provider", "name"]
530
+ }
531
+ },
532
+
533
+ // Network Methods
534
+ {
535
+ name: "network_get_network",
536
+ description: "Get the current network information",
537
+ inputSchema: {
538
+ type: "object",
539
+ properties: {
540
+ provider: { type: "string", description: "JSON RPC provider URL" }
541
+ },
542
+ required: ["provider"]
543
+ }
544
+ },
545
+ {
546
+ name: "network_get_block_number",
547
+ description: "Get the current block number",
548
+ inputSchema: {
549
+ type: "object",
550
+ properties: {
551
+ provider: { type: "string", description: "JSON RPC provider URL" }
552
+ },
553
+ required: ["provider"]
554
+ }
555
+ },
556
+ {
557
+ name: "network_get_fee_data",
558
+ description: "Get the current fee data (base fee, max priority fee, etc.)",
559
+ inputSchema: {
560
+ type: "object",
561
+ properties: {
562
+ provider: { type: "string", description: "JSON RPC provider URL" }
563
+ },
564
+ required: ["provider"]
565
+ }
566
+ }
567
+ ];
568
+
569
+ type HandlerDictionary = Record<string, (input: any) => any>;
570
+
571
+ export const handlers: HandlerDictionary = {
572
+ // Wallet Creation and Management
573
+ "wallet_create_random": createWalletHandler,
574
+ "wallet_from_private_key": fromPrivateKeyHandler,
575
+ "wallet_from_mnemonic": fromMnemonicHandler,
576
+ "wallet_from_encrypted_json": fromEncryptedJsonHandler,
577
+ "wallet_encrypt": encryptWalletHandler,
578
+
579
+ // Wallet Properties
580
+ "wallet_get_address": getAddressHandler,
581
+ "wallet_get_public_key": getPublicKeyHandler,
582
+ "wallet_get_private_key": getPrivateKeyHandler,
583
+
584
+ // Blockchain Methods
585
+ "wallet_get_balance": getBalanceHandler,
586
+ "wallet_get_chain_id": getChainIdHandler,
587
+ "wallet_get_gas_price": getGasPriceHandler,
588
+ "wallet_get_transaction_count": getTransactionCountHandler,
589
+ "wallet_call": callHandler,
590
+
591
+ // Transaction Methods
592
+ "wallet_send_transaction": sendTransactionHandler,
593
+ "wallet_sign_transaction": signTransactionHandler,
594
+ "wallet_populate_transaction": populateTransactionHandler,
595
+
596
+ // Signing Methods
597
+ "wallet_sign_message": signMessageHandler,
598
+ "wallet_sign_typed_data": signTypedDataHandler,
599
+ "wallet_verify_message": verifyMessageHandler,
600
+ "wallet_verify_typed_data": verifyTypedDataHandler,
601
+
602
+ // Provider Methods
603
+ "provider_get_block": getBlockHandler,
604
+ "provider_get_transaction": getTransactionHandler,
605
+ "provider_get_transaction_receipt": getTransactionReceiptHandler,
606
+ "provider_get_code": getCodeHandler,
607
+ "provider_get_storage_at": getStorageAtHandler,
608
+ "provider_estimate_gas": estimateGasHandler,
609
+ "provider_get_logs": getLogsHandler,
610
+ "provider_get_ens_resolver": getEnsResolverHandler,
611
+ "provider_lookup_address": lookupAddressHandler,
612
+ "provider_resolve_name": resolveNameHandler,
613
+
614
+ // Network Methods
615
+ "network_get_network": getNetworkHandler,
616
+ "network_get_block_number": getBlockNumberHandler,
617
+ "network_get_fee_data": getFeeDataHandler,
618
+
619
+ // Mnemonic Methods
620
+ "wallet_create_mnemonic_phrase": createMnemonicPhraseHandler
621
+ };
package/src/types.ts ADDED
@@ -0,0 +1,21 @@
1
+ export type ToolResultSchema<T> = {
2
+ content: ToolResultContent[];
3
+ isError?: boolean;
4
+ toolResult?: T;
5
+ }
6
+
7
+ export type ToolResultContent = {
8
+ type: "text";
9
+ text: string;
10
+ } | {
11
+ type: "image";
12
+ data: string; // base64 encoded image data
13
+ mimeType: string;
14
+ } | {
15
+ type: "resource";
16
+ resource: {
17
+ url: string;
18
+ mimeType: string;
19
+ text: string;
20
+ }
21
+ }