@paylobster/mcp-server 1.5.0 → 1.7.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.
- package/README.md +147 -228
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +86 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -19
- package/dist/index.js.map +1 -1
- package/dist/resources/index.d.ts +9 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +159 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/server.d.ts +3 -6
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1455 -114
- package/dist/server.js.map +1 -1
- package/dist/tools/balance.d.ts +5 -16
- package/dist/tools/balance.d.ts.map +1 -1
- package/dist/tools/balance.js +26 -44
- package/dist/tools/balance.js.map +1 -1
- package/dist/tools/bridge.d.ts +142 -0
- package/dist/tools/bridge.d.ts.map +1 -0
- package/dist/tools/bridge.js +121 -0
- package/dist/tools/bridge.js.map +1 -0
- package/dist/tools/cascade.d.ts +59 -0
- package/dist/tools/cascade.d.ts.map +1 -0
- package/dist/tools/cascade.js +119 -0
- package/dist/tools/cascade.js.map +1 -0
- package/dist/tools/compliance.d.ts +36 -0
- package/dist/tools/compliance.d.ts.map +1 -0
- package/dist/tools/compliance.js +57 -0
- package/dist/tools/compliance.js.map +1 -0
- package/dist/tools/convenience.d.ts +121 -0
- package/dist/tools/convenience.d.ts.map +1 -0
- package/dist/tools/convenience.js +331 -0
- package/dist/tools/convenience.js.map +1 -0
- package/dist/tools/credit.d.ts +46 -0
- package/dist/tools/credit.d.ts.map +1 -0
- package/dist/tools/credit.js +102 -0
- package/dist/tools/credit.js.map +1 -0
- package/dist/tools/disputes.d.ts +71 -0
- package/dist/tools/disputes.d.ts.map +1 -0
- package/dist/tools/disputes.js +121 -0
- package/dist/tools/disputes.js.map +1 -0
- package/dist/tools/escrow.d.ts +90 -31
- package/dist/tools/escrow.d.ts.map +1 -1
- package/dist/tools/escrow.js +215 -98
- package/dist/tools/escrow.js.map +1 -1
- package/dist/tools/intent.d.ts +78 -0
- package/dist/tools/intent.d.ts.map +1 -0
- package/dist/tools/intent.js +192 -0
- package/dist/tools/intent.js.map +1 -0
- package/dist/tools/investment.d.ts +196 -0
- package/dist/tools/investment.d.ts.map +1 -0
- package/dist/tools/investment.js +415 -0
- package/dist/tools/investment.js.map +1 -0
- package/dist/tools/links.d.ts +41 -0
- package/dist/tools/links.d.ts.map +1 -0
- package/dist/tools/links.js +78 -0
- package/dist/tools/links.js.map +1 -0
- package/dist/tools/portfolio.d.ts +44 -0
- package/dist/tools/portfolio.d.ts.map +1 -0
- package/dist/tools/portfolio.js +166 -0
- package/dist/tools/portfolio.js.map +1 -0
- package/dist/tools/price-alerts.d.ts +52 -0
- package/dist/tools/price-alerts.d.ts.map +1 -0
- package/dist/tools/price-alerts.js +78 -0
- package/dist/tools/price-alerts.js.map +1 -0
- package/dist/tools/refunds.d.ts +32 -0
- package/dist/tools/refunds.d.ts.map +1 -0
- package/dist/tools/refunds.js +75 -0
- package/dist/tools/refunds.js.map +1 -0
- package/dist/tools/reputation.d.ts +49 -15
- package/dist/tools/reputation.d.ts.map +1 -1
- package/dist/tools/reputation.js +107 -45
- package/dist/tools/reputation.js.map +1 -1
- package/dist/tools/revenue.d.ts +42 -0
- package/dist/tools/revenue.d.ts.map +1 -0
- package/dist/tools/revenue.js +67 -0
- package/dist/tools/revenue.js.map +1 -0
- package/dist/tools/search.d.ts +54 -30
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +85 -122
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/streaming.d.ts +60 -0
- package/dist/tools/streaming.d.ts.map +1 -0
- package/dist/tools/streaming.js +163 -0
- package/dist/tools/streaming.js.map +1 -0
- package/dist/tools/swap-smart.d.ts +30 -0
- package/dist/tools/swap-smart.d.ts.map +1 -0
- package/dist/tools/swap-smart.js +135 -0
- package/dist/tools/swap-smart.js.map +1 -0
- package/dist/tools/swap.d.ts +93 -0
- package/dist/tools/swap.d.ts.map +1 -0
- package/dist/tools/swap.js +150 -0
- package/dist/tools/swap.js.map +1 -0
- package/dist/tools/treasury.d.ts +267 -0
- package/dist/tools/treasury.d.ts.map +1 -0
- package/dist/tools/treasury.js +722 -0
- package/dist/tools/treasury.js.map +1 -0
- package/dist/tools/trust-graph.d.ts +105 -0
- package/dist/tools/trust-graph.d.ts.map +1 -0
- package/dist/tools/trust-graph.js +232 -0
- package/dist/tools/trust-graph.js.map +1 -0
- package/dist/tools/webhooks.d.ts +60 -0
- package/dist/tools/webhooks.d.ts.map +1 -0
- package/dist/tools/webhooks.js +133 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/types/index.d.ts +84 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/{lib/types.js → types/index.js} +1 -1
- package/dist/types/index.js.map +1 -0
- package/dist/utils/contracts.d.ts +553 -0
- package/dist/utils/contracts.d.ts.map +1 -0
- package/dist/utils/contracts.js +403 -0
- package/dist/utils/contracts.js.map +1 -0
- package/package.json +11 -20
- package/BUILD_SUMMARY.md +0 -294
- package/CHANGELOG.md +0 -77
- package/COMPLETION_REPORT.md +0 -284
- package/INTEGRATION.md +0 -286
- package/QUICKSTART.md +0 -226
- package/dist/lib/config.d.ts +0 -7
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js +0 -16
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/contracts.d.ts +0 -15
- package/dist/lib/contracts.d.ts.map +0 -1
- package/dist/lib/contracts.js +0 -148
- package/dist/lib/contracts.js.map +0 -1
- package/dist/lib/types.d.ts +0 -39
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/types.js.map +0 -1
- package/dist/resources/agent.d.ts +0 -3
- package/dist/resources/agent.d.ts.map +0 -1
- package/dist/resources/agent.js +0 -36
- package/dist/resources/agent.js.map +0 -1
- package/dist/resources/escrow.d.ts +0 -3
- package/dist/resources/escrow.d.ts.map +0 -1
- package/dist/resources/escrow.js +0 -33
- package/dist/resources/escrow.js.map +0 -1
- package/dist/resources/services.d.ts +0 -2
- package/dist/resources/services.d.ts.map +0 -1
- package/dist/resources/services.js +0 -55
- package/dist/resources/services.js.map +0 -1
- package/dist/tools/agent.d.ts +0 -17
- package/dist/tools/agent.d.ts.map +0 -1
- package/dist/tools/agent.js +0 -51
- package/dist/tools/agent.js.map +0 -1
- package/examples/test-server.ts +0 -36
- package/examples/test-tools.ts +0 -64
- package/src/__tests__/server.test.ts +0 -24
- package/src/index.ts +0 -24
- package/src/lib/config.ts +0 -22
- package/src/lib/contracts.ts +0 -164
- package/src/lib/types.ts +0 -44
- package/src/resources/agent.ts +0 -40
- package/src/resources/escrow.ts +0 -35
- package/src/resources/services.ts +0 -53
- package/src/server.ts +0 -190
- package/src/tools/agent.ts +0 -56
- package/src/tools/balance.ts +0 -61
- package/src/tools/escrow.ts +0 -142
- package/src/tools/reputation.ts +0 -69
- package/src/tools/search.ts +0 -148
- package/tsconfig.json +0 -20
package/dist/server.js
CHANGED
|
@@ -4,28 +4,39 @@ exports.PayLobsterMCPServer = void 0;
|
|
|
4
4
|
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
5
5
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
6
6
|
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
const contracts_js_1 = require("./utils/contracts.js");
|
|
8
|
+
const search_js_1 = require("./tools/search.js");
|
|
9
|
+
const escrow_js_1 = require("./tools/escrow.js");
|
|
10
10
|
const reputation_js_1 = require("./tools/reputation.js");
|
|
11
11
|
const balance_js_1 = require("./tools/balance.js");
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
12
|
+
const streaming_js_1 = require("./tools/streaming.js");
|
|
13
|
+
const disputes_js_1 = require("./tools/disputes.js");
|
|
14
|
+
const credit_js_1 = require("./tools/credit.js");
|
|
15
|
+
const cascade_js_1 = require("./tools/cascade.js");
|
|
16
|
+
const intent_js_1 = require("./tools/intent.js");
|
|
17
|
+
const revenue_js_1 = require("./tools/revenue.js");
|
|
18
|
+
const compliance_js_1 = require("./tools/compliance.js");
|
|
19
|
+
const trust_graph_js_1 = require("./tools/trust-graph.js");
|
|
20
|
+
const links_js_1 = require("./tools/links.js");
|
|
21
|
+
const webhooks_js_1 = require("./tools/webhooks.js");
|
|
22
|
+
const refunds_js_1 = require("./tools/refunds.js");
|
|
23
|
+
const swap_js_1 = require("./tools/swap.js");
|
|
24
|
+
const bridge_js_1 = require("./tools/bridge.js");
|
|
25
|
+
const portfolio_js_1 = require("./tools/portfolio.js");
|
|
26
|
+
const treasury_js_1 = require("./tools/treasury.js");
|
|
27
|
+
const investment_js_1 = require("./tools/investment.js");
|
|
28
|
+
const convenience_js_1 = require("./tools/convenience.js");
|
|
29
|
+
const swap_smart_js_1 = require("./tools/swap-smart.js");
|
|
30
|
+
const price_alerts_js_1 = require("./tools/price-alerts.js");
|
|
31
|
+
const index_js_2 = require("./resources/index.js");
|
|
19
32
|
class PayLobsterMCPServer {
|
|
20
33
|
server;
|
|
21
|
-
|
|
22
|
-
contracts;
|
|
34
|
+
client;
|
|
23
35
|
constructor(config) {
|
|
24
|
-
this.
|
|
25
|
-
this.contracts = new contracts_js_1.ContractsClient(this.config);
|
|
36
|
+
this.client = new contracts_js_1.ContractClient(config);
|
|
26
37
|
this.server = new index_js_1.Server({
|
|
27
|
-
name: 'paylobster
|
|
28
|
-
version: '1.
|
|
38
|
+
name: '@paylobster/mcp-server',
|
|
39
|
+
version: '1.4.0',
|
|
29
40
|
}, {
|
|
30
41
|
capabilities: {
|
|
31
42
|
tools: {},
|
|
@@ -38,132 +49,1462 @@ class PayLobsterMCPServer {
|
|
|
38
49
|
// List available tools
|
|
39
50
|
this.server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
40
51
|
tools: [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
{
|
|
53
|
+
name: 'search_services',
|
|
54
|
+
description: 'Find PayLobster services by capabilities, category, or price',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
query: { type: 'string', description: 'Semantic search query' },
|
|
59
|
+
filters: {
|
|
60
|
+
type: 'object',
|
|
61
|
+
properties: {
|
|
62
|
+
category: { type: 'string' },
|
|
63
|
+
capabilities: { type: 'array', items: { type: 'string' } },
|
|
64
|
+
maxPrice: { type: 'string' },
|
|
65
|
+
minReputation: { type: 'number' },
|
|
66
|
+
currency: { type: 'string', default: 'USDC' },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
sort: { type: 'string', enum: ['price', 'reputation', 'relevance'], default: 'relevance' },
|
|
70
|
+
limit: { type: 'number', default: 20 },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'create_escrow',
|
|
76
|
+
description: 'Create a payment escrow for a service',
|
|
77
|
+
inputSchema: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
properties: {
|
|
80
|
+
to: { type: 'string', description: 'Recipient address' },
|
|
81
|
+
amount: { type: 'string', description: 'Amount in USDC' },
|
|
82
|
+
currency: { type: 'string', default: 'USDC' },
|
|
83
|
+
terms: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
releaseOn: { type: 'string', enum: ['delivery-confirmed', 'timeout', 'manual'] },
|
|
87
|
+
timeout: { type: 'string', description: 'ISO 8601 duration' },
|
|
88
|
+
disputeWindow: { type: 'string', description: 'ISO 8601 duration' },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
metadata: { type: 'object' },
|
|
92
|
+
},
|
|
93
|
+
required: ['to', 'amount'],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'release_escrow',
|
|
98
|
+
description: 'Release funds from an escrow',
|
|
99
|
+
inputSchema: {
|
|
100
|
+
type: 'object',
|
|
101
|
+
properties: {
|
|
102
|
+
escrowId: { type: 'string', description: 'Escrow ID' },
|
|
103
|
+
},
|
|
104
|
+
required: ['escrowId'],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'get_escrow',
|
|
109
|
+
description: 'Get details of a specific escrow',
|
|
110
|
+
inputSchema: {
|
|
111
|
+
type: 'object',
|
|
112
|
+
properties: {
|
|
113
|
+
escrowId: { type: 'string', description: 'Escrow ID' },
|
|
114
|
+
},
|
|
115
|
+
required: ['escrowId'],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'list_escrows',
|
|
120
|
+
description: 'List escrows by creator or provider',
|
|
121
|
+
inputSchema: {
|
|
122
|
+
type: 'object',
|
|
123
|
+
properties: {
|
|
124
|
+
creator: { type: 'string', description: 'Filter by creator address' },
|
|
125
|
+
provider: { type: 'string', description: 'Filter by provider address' },
|
|
126
|
+
status: { type: 'string', enum: ['pending', 'active', 'released', 'disputed', 'refunded'] },
|
|
127
|
+
limit: { type: 'number', default: 20 },
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'get_reputation',
|
|
133
|
+
description: 'Check an agent\'s reputation score and history',
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: 'object',
|
|
136
|
+
properties: {
|
|
137
|
+
address: { type: 'string', description: 'Ethereum address' },
|
|
138
|
+
},
|
|
139
|
+
required: ['address'],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'register_agent',
|
|
144
|
+
description: 'Register agent identity on PayLobster',
|
|
145
|
+
inputSchema: {
|
|
146
|
+
type: 'object',
|
|
147
|
+
properties: {
|
|
148
|
+
name: { type: 'string', description: 'Agent name' },
|
|
149
|
+
metadata: {
|
|
150
|
+
type: 'object',
|
|
151
|
+
properties: {
|
|
152
|
+
description: { type: 'string' },
|
|
153
|
+
website: { type: 'string' },
|
|
154
|
+
contact: { type: 'string' },
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
stake: { type: 'string', description: 'USDC amount to stake (minimum 100)' },
|
|
158
|
+
},
|
|
159
|
+
required: ['name', 'stake'],
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'get_balance',
|
|
164
|
+
description: 'Check USDC and credit balance',
|
|
165
|
+
inputSchema: {
|
|
166
|
+
type: 'object',
|
|
167
|
+
properties: {},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'create_streaming_payment',
|
|
172
|
+
description: 'Create a streaming payment to another agent',
|
|
173
|
+
inputSchema: {
|
|
174
|
+
type: 'object',
|
|
175
|
+
properties: {
|
|
176
|
+
to: { type: 'string', description: 'Recipient address' },
|
|
177
|
+
amountPerSecond: { type: 'string', description: 'Amount per second in USDC' },
|
|
178
|
+
duration: { type: 'string', description: 'ISO 8601 duration (e.g., P1D for 1 day)' },
|
|
179
|
+
metadata: { type: 'object' },
|
|
180
|
+
},
|
|
181
|
+
required: ['to', 'amountPerSecond', 'duration'],
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'cancel_stream',
|
|
186
|
+
description: 'Cancel an active stream',
|
|
187
|
+
inputSchema: {
|
|
188
|
+
type: 'object',
|
|
189
|
+
properties: {
|
|
190
|
+
streamId: { type: 'string', description: 'Stream ID' },
|
|
191
|
+
},
|
|
192
|
+
required: ['streamId'],
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: 'get_stream',
|
|
197
|
+
description: 'Get stream details',
|
|
198
|
+
inputSchema: {
|
|
199
|
+
type: 'object',
|
|
200
|
+
properties: {
|
|
201
|
+
streamId: { type: 'string', description: 'Stream ID' },
|
|
202
|
+
},
|
|
203
|
+
required: ['streamId'],
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: 'open_dispute',
|
|
208
|
+
description: 'Open a dispute on an escrow',
|
|
209
|
+
inputSchema: {
|
|
210
|
+
type: 'object',
|
|
211
|
+
properties: {
|
|
212
|
+
escrowId: { type: 'string', description: 'Escrow ID to dispute' },
|
|
213
|
+
reason: { type: 'string', description: 'Reason for dispute' },
|
|
214
|
+
evidence: { type: 'string', description: 'Initial evidence (IPFS hash or URL)' },
|
|
215
|
+
},
|
|
216
|
+
required: ['escrowId', 'reason'],
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: 'submit_evidence',
|
|
221
|
+
description: 'Submit evidence for a dispute',
|
|
222
|
+
inputSchema: {
|
|
223
|
+
type: 'object',
|
|
224
|
+
properties: {
|
|
225
|
+
disputeId: { type: 'string', description: 'Dispute ID' },
|
|
226
|
+
evidence: { type: 'string', description: 'Evidence (IPFS hash or URL)' },
|
|
227
|
+
description: { type: 'string', description: 'Description of evidence' },
|
|
228
|
+
},
|
|
229
|
+
required: ['disputeId', 'evidence', 'description'],
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: 'get_dispute',
|
|
234
|
+
description: 'Get dispute details',
|
|
235
|
+
inputSchema: {
|
|
236
|
+
type: 'object',
|
|
237
|
+
properties: {
|
|
238
|
+
disputeId: { type: 'string', description: 'Dispute ID' },
|
|
239
|
+
},
|
|
240
|
+
required: ['disputeId'],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'get_credit_score',
|
|
245
|
+
description: "Get an agent's credit score",
|
|
246
|
+
inputSchema: {
|
|
247
|
+
type: 'object',
|
|
248
|
+
properties: {
|
|
249
|
+
address: { type: 'string', description: 'Agent address' },
|
|
250
|
+
},
|
|
251
|
+
required: ['address'],
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: 'request_credit_line',
|
|
256
|
+
description: 'Request a credit line',
|
|
257
|
+
inputSchema: {
|
|
258
|
+
type: 'object',
|
|
259
|
+
properties: {
|
|
260
|
+
amount: { type: 'string', description: 'Requested credit line amount in USDC' },
|
|
261
|
+
duration: { type: 'string', description: 'ISO 8601 duration (e.g., P30D for 30 days)' },
|
|
262
|
+
collateral: { type: 'string', description: 'Collateral amount in USDC' },
|
|
263
|
+
},
|
|
264
|
+
required: ['amount', 'duration'],
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: 'create_cascade',
|
|
269
|
+
description: 'Create cascading multi-agent escrow',
|
|
270
|
+
inputSchema: {
|
|
271
|
+
type: 'object',
|
|
272
|
+
properties: {
|
|
273
|
+
levels: {
|
|
274
|
+
type: 'array',
|
|
275
|
+
items: {
|
|
276
|
+
type: 'object',
|
|
277
|
+
properties: {
|
|
278
|
+
recipient: { type: 'string', description: 'Recipient address' },
|
|
279
|
+
amount: { type: 'string', description: 'Amount in USDC' },
|
|
280
|
+
releaseCondition: { type: 'string', description: 'Condition for release' },
|
|
281
|
+
},
|
|
282
|
+
required: ['recipient', 'amount', 'releaseCondition'],
|
|
283
|
+
},
|
|
284
|
+
description: 'Cascade levels in order',
|
|
285
|
+
},
|
|
286
|
+
metadata: { type: 'object' },
|
|
287
|
+
},
|
|
288
|
+
required: ['levels'],
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: 'release_cascade_level',
|
|
293
|
+
description: 'Release a cascade level',
|
|
294
|
+
inputSchema: {
|
|
295
|
+
type: 'object',
|
|
296
|
+
properties: {
|
|
297
|
+
cascadeId: { type: 'string', description: 'Cascade ID' },
|
|
298
|
+
level: { type: 'number', description: 'Level to release (0-indexed)' },
|
|
299
|
+
},
|
|
300
|
+
required: ['cascadeId', 'level'],
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: 'post_intent',
|
|
305
|
+
description: 'Post a service intent to marketplace',
|
|
306
|
+
inputSchema: {
|
|
307
|
+
type: 'object',
|
|
308
|
+
properties: {
|
|
309
|
+
description: { type: 'string', description: 'Service intent description' },
|
|
310
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Service tags for discovery' },
|
|
311
|
+
budget: { type: 'string', description: 'Maximum budget in USDC' },
|
|
312
|
+
deadline: { type: 'string', description: 'ISO 8601 duration or timestamp' },
|
|
313
|
+
requirements: { type: 'object' },
|
|
314
|
+
},
|
|
315
|
+
required: ['description', 'tags', 'budget', 'deadline'],
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
name: 'search_intents',
|
|
320
|
+
description: 'Search intents by tags',
|
|
321
|
+
inputSchema: {
|
|
322
|
+
type: 'object',
|
|
323
|
+
properties: {
|
|
324
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Filter by tags' },
|
|
325
|
+
minBudget: { type: 'string', description: 'Minimum budget in USDC' },
|
|
326
|
+
maxBudget: { type: 'string', description: 'Maximum budget in USDC' },
|
|
327
|
+
limit: { type: 'number', default: 20 },
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: 'accept_offer',
|
|
333
|
+
description: 'Accept an offer on your intent',
|
|
334
|
+
inputSchema: {
|
|
335
|
+
type: 'object',
|
|
336
|
+
properties: {
|
|
337
|
+
intentId: { type: 'string', description: 'Intent ID' },
|
|
338
|
+
offerId: { type: 'string', description: 'Offer ID to accept' },
|
|
339
|
+
},
|
|
340
|
+
required: ['intentId', 'offerId'],
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'create_revenue_share',
|
|
345
|
+
description: 'Create revenue sharing agreement',
|
|
346
|
+
inputSchema: {
|
|
347
|
+
type: 'object',
|
|
348
|
+
properties: {
|
|
349
|
+
participants: {
|
|
350
|
+
type: 'array',
|
|
351
|
+
items: {
|
|
352
|
+
type: 'object',
|
|
353
|
+
properties: {
|
|
354
|
+
address: { type: 'string', description: 'Participant address' },
|
|
355
|
+
share: { type: 'number', description: 'Share percentage (0-100)' },
|
|
356
|
+
},
|
|
357
|
+
required: ['address', 'share'],
|
|
358
|
+
},
|
|
359
|
+
description: 'Revenue share participants',
|
|
360
|
+
},
|
|
361
|
+
sourceEscrow: { type: 'string', description: 'Link to source escrow' },
|
|
362
|
+
metadata: { type: 'object' },
|
|
363
|
+
},
|
|
364
|
+
required: ['participants'],
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
name: 'check_compliance',
|
|
369
|
+
description: 'Check agent compliance status',
|
|
370
|
+
inputSchema: {
|
|
371
|
+
type: 'object',
|
|
372
|
+
properties: {
|
|
373
|
+
address: { type: 'string', description: 'Agent address to check' },
|
|
374
|
+
checkTypes: { type: 'array', items: { type: 'string' }, description: 'Specific checks to run (kyc, sanctions, risk)' },
|
|
375
|
+
},
|
|
376
|
+
required: ['address'],
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
name: 'trust_endorse',
|
|
381
|
+
description: 'Endorse another agent with a trust level (1-100)',
|
|
382
|
+
inputSchema: {
|
|
383
|
+
type: 'object',
|
|
384
|
+
properties: {
|
|
385
|
+
agent: { type: 'string', description: 'Agent address to endorse' },
|
|
386
|
+
trustLevel: { type: 'number', minimum: 1, maximum: 100, description: 'Trust level (1-100)' },
|
|
387
|
+
},
|
|
388
|
+
required: ['agent', 'trustLevel'],
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
name: 'trust_revoke',
|
|
393
|
+
description: 'Revoke an endorsement',
|
|
394
|
+
inputSchema: {
|
|
395
|
+
type: 'object',
|
|
396
|
+
properties: {
|
|
397
|
+
agent: { type: 'string', description: 'Agent address to revoke endorsement from' },
|
|
398
|
+
},
|
|
399
|
+
required: ['agent'],
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: 'trust_check_direct',
|
|
404
|
+
description: 'Get direct trust level between two agents',
|
|
405
|
+
inputSchema: {
|
|
406
|
+
type: 'object',
|
|
407
|
+
properties: {
|
|
408
|
+
from: { type: 'string', description: 'Source agent address' },
|
|
409
|
+
to: { type: 'string', description: 'Target agent address' },
|
|
410
|
+
},
|
|
411
|
+
required: ['from', 'to'],
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: 'trust_check_inferred',
|
|
416
|
+
description: 'Calculate inferred trust through the network (BFS with decay)',
|
|
417
|
+
inputSchema: {
|
|
418
|
+
type: 'object',
|
|
419
|
+
properties: {
|
|
420
|
+
from: { type: 'string', description: 'Source agent address' },
|
|
421
|
+
to: { type: 'string', description: 'Target agent address' },
|
|
422
|
+
maxDepth: { type: 'number', default: 4, description: 'Maximum hops to search (default: 4)' },
|
|
423
|
+
},
|
|
424
|
+
required: ['from', 'to'],
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: 'trust_endorsements',
|
|
429
|
+
description: 'List all agents endorsed by an address',
|
|
430
|
+
inputSchema: {
|
|
431
|
+
type: 'object',
|
|
432
|
+
properties: {
|
|
433
|
+
agent: { type: 'string', description: 'Agent address' },
|
|
434
|
+
},
|
|
435
|
+
required: ['agent'],
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
name: 'trust_endorsers',
|
|
440
|
+
description: 'List all agents who endorse an address',
|
|
441
|
+
inputSchema: {
|
|
442
|
+
type: 'object',
|
|
443
|
+
properties: {
|
|
444
|
+
agent: { type: 'string', description: 'Agent address' },
|
|
445
|
+
},
|
|
446
|
+
required: ['agent'],
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: 'trust_aggregate',
|
|
451
|
+
description: 'Get aggregate trust score for an agent (reputation-weighted)',
|
|
452
|
+
inputSchema: {
|
|
453
|
+
type: 'object',
|
|
454
|
+
properties: {
|
|
455
|
+
agent: { type: 'string', description: 'Agent address' },
|
|
456
|
+
},
|
|
457
|
+
required: ['agent'],
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
name: 'swap_quote',
|
|
462
|
+
description: 'Get swap quote for Base tokens via 0x API',
|
|
463
|
+
inputSchema: {
|
|
464
|
+
type: 'object',
|
|
465
|
+
properties: {
|
|
466
|
+
sellToken: { type: 'string', description: 'Token address or symbol to sell' },
|
|
467
|
+
buyToken: { type: 'string', description: 'Token address or symbol to buy' },
|
|
468
|
+
sellAmount: { type: 'string', description: 'Amount to sell (in token units)' },
|
|
469
|
+
buyAmount: { type: 'string', description: 'Amount to buy (in token units)' },
|
|
470
|
+
slippagePercentage: { type: 'number', default: 0.01, description: 'Slippage tolerance (0.01 = 1%)' },
|
|
471
|
+
takerAddress: { type: 'string', description: 'Address that will submit the transaction' },
|
|
472
|
+
},
|
|
473
|
+
required: ['sellToken', 'buyToken'],
|
|
474
|
+
},
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: 'swap_execute',
|
|
478
|
+
description: 'Execute swap (returns unsigned tx)',
|
|
479
|
+
inputSchema: {
|
|
480
|
+
type: 'object',
|
|
481
|
+
properties: {
|
|
482
|
+
sellToken: { type: 'string', description: 'Token address or symbol to sell' },
|
|
483
|
+
buyToken: { type: 'string', description: 'Token address or symbol to buy' },
|
|
484
|
+
sellAmount: { type: 'string', description: 'Amount to sell (in token units)' },
|
|
485
|
+
buyAmount: { type: 'string', description: 'Amount to buy (in token units)' },
|
|
486
|
+
slippagePercentage: { type: 'number', default: 0.01, description: 'Slippage tolerance (0.01 = 1%)' },
|
|
487
|
+
},
|
|
488
|
+
required: ['sellToken', 'buyToken'],
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
name: 'swap_tokens',
|
|
493
|
+
description: 'List available tokens on Base',
|
|
494
|
+
inputSchema: {
|
|
495
|
+
type: 'object',
|
|
496
|
+
properties: {
|
|
497
|
+
query: { type: 'string', description: 'Search query to filter tokens' },
|
|
498
|
+
},
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
name: 'swap_price',
|
|
503
|
+
description: 'Get token price in USDC',
|
|
504
|
+
inputSchema: {
|
|
505
|
+
type: 'object',
|
|
506
|
+
properties: {
|
|
507
|
+
token: { type: 'string', description: 'Token address or symbol' },
|
|
508
|
+
},
|
|
509
|
+
required: ['token'],
|
|
510
|
+
},
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
name: 'bridge_quote',
|
|
514
|
+
description: 'Get cross-chain bridge quote via Li.Fi',
|
|
515
|
+
inputSchema: {
|
|
516
|
+
type: 'object',
|
|
517
|
+
properties: {
|
|
518
|
+
fromChain: { type: ['string', 'number'], description: 'Source chain ID or name' },
|
|
519
|
+
toChain: { type: ['string', 'number'], description: 'Destination chain ID or name' },
|
|
520
|
+
fromToken: { type: 'string', description: 'Source token address' },
|
|
521
|
+
toToken: { type: 'string', description: 'Destination token address' },
|
|
522
|
+
fromAmount: { type: 'string', description: 'Amount to bridge (in token units)' },
|
|
523
|
+
fromAddress: { type: 'string', description: 'Sender address' },
|
|
524
|
+
toAddress: { type: 'string', description: 'Recipient address (defaults to fromAddress)' },
|
|
525
|
+
},
|
|
526
|
+
required: ['fromChain', 'toChain', 'fromToken', 'toToken', 'fromAmount'],
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
name: 'bridge_execute',
|
|
531
|
+
description: 'Execute bridge (returns tx data)',
|
|
532
|
+
inputSchema: {
|
|
533
|
+
type: 'object',
|
|
534
|
+
properties: {
|
|
535
|
+
fromChain: { type: ['string', 'number'], description: 'Source chain ID or name' },
|
|
536
|
+
toChain: { type: ['string', 'number'], description: 'Destination chain ID or name' },
|
|
537
|
+
fromToken: { type: 'string', description: 'Source token address' },
|
|
538
|
+
toToken: { type: 'string', description: 'Destination token address' },
|
|
539
|
+
fromAmount: { type: 'string', description: 'Amount to bridge (in token units)' },
|
|
540
|
+
toAddress: { type: 'string', description: 'Recipient address' },
|
|
541
|
+
},
|
|
542
|
+
required: ['fromChain', 'toChain', 'fromToken', 'toToken', 'fromAmount'],
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
name: 'bridge_status',
|
|
547
|
+
description: 'Check bridge transaction status',
|
|
548
|
+
inputSchema: {
|
|
549
|
+
type: 'object',
|
|
550
|
+
properties: {
|
|
551
|
+
txHash: { type: 'string', description: 'Transaction hash to check' },
|
|
552
|
+
fromChain: { type: ['string', 'number'], description: 'Source chain ID' },
|
|
553
|
+
toChain: { type: ['string', 'number'], description: 'Destination chain ID' },
|
|
554
|
+
},
|
|
555
|
+
required: ['txHash'],
|
|
556
|
+
},
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
name: 'bridge_chains',
|
|
560
|
+
description: 'List supported chains',
|
|
561
|
+
inputSchema: {
|
|
562
|
+
type: 'object',
|
|
563
|
+
properties: {
|
|
564
|
+
query: { type: 'string', description: 'Filter chains by name' },
|
|
565
|
+
},
|
|
566
|
+
},
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: 'get_portfolio',
|
|
570
|
+
description: 'Get all token balances for an address on Base',
|
|
571
|
+
inputSchema: {
|
|
572
|
+
type: 'object',
|
|
573
|
+
properties: {
|
|
574
|
+
address: { type: 'string', description: 'Ethereum address to get portfolio for' },
|
|
575
|
+
},
|
|
576
|
+
required: ['address'],
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
name: 'get_token_price',
|
|
581
|
+
description: 'Get price of any token on Base',
|
|
582
|
+
inputSchema: {
|
|
583
|
+
type: 'object',
|
|
584
|
+
properties: {
|
|
585
|
+
tokenAddress: { type: 'string', description: 'Token contract address on Base' },
|
|
586
|
+
},
|
|
587
|
+
required: ['tokenAddress'],
|
|
588
|
+
},
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
name: 'treasury_create',
|
|
592
|
+
description: 'Create a new agent treasury',
|
|
593
|
+
inputSchema: {
|
|
594
|
+
type: 'object',
|
|
595
|
+
properties: {
|
|
596
|
+
name: { type: 'string', description: 'Treasury name' },
|
|
597
|
+
},
|
|
598
|
+
required: ['name'],
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
name: 'treasury_info',
|
|
603
|
+
description: 'Get treasury summary including name, owner, balances, members, and stats',
|
|
604
|
+
inputSchema: {
|
|
605
|
+
type: 'object',
|
|
606
|
+
properties: {
|
|
607
|
+
address: { type: 'string', description: 'Treasury address' },
|
|
608
|
+
},
|
|
609
|
+
required: ['address'],
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
name: 'treasury_balances',
|
|
614
|
+
description: 'Get all token balances in a treasury',
|
|
615
|
+
inputSchema: {
|
|
616
|
+
type: 'object',
|
|
617
|
+
properties: {
|
|
618
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
619
|
+
},
|
|
620
|
+
required: ['treasuryAddress'],
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
name: 'treasury_deposit',
|
|
625
|
+
description: 'Deposit tokens into a treasury',
|
|
626
|
+
inputSchema: {
|
|
627
|
+
type: 'object',
|
|
628
|
+
properties: {
|
|
629
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
630
|
+
token: { type: 'string', description: 'Token address' },
|
|
631
|
+
amount: { type: 'string', description: 'Amount to deposit (in token units)' },
|
|
632
|
+
},
|
|
633
|
+
required: ['treasuryAddress', 'token', 'amount'],
|
|
634
|
+
},
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
name: 'treasury_withdraw',
|
|
638
|
+
description: 'Withdraw tokens from a treasury',
|
|
639
|
+
inputSchema: {
|
|
640
|
+
type: 'object',
|
|
641
|
+
properties: {
|
|
642
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
643
|
+
token: { type: 'string', description: 'Token address' },
|
|
644
|
+
to: { type: 'string', description: 'Recipient address' },
|
|
645
|
+
amount: { type: 'string', description: 'Amount to withdraw (in token units)' },
|
|
646
|
+
reason: { type: 'string', description: 'Withdrawal reason' },
|
|
647
|
+
},
|
|
648
|
+
required: ['treasuryAddress', 'token', 'to', 'amount', 'reason'],
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
name: 'treasury_members',
|
|
653
|
+
description: 'List all members and their roles in a treasury',
|
|
654
|
+
inputSchema: {
|
|
655
|
+
type: 'object',
|
|
656
|
+
properties: {
|
|
657
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
658
|
+
},
|
|
659
|
+
required: ['treasuryAddress'],
|
|
660
|
+
},
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
name: 'treasury_grant_role',
|
|
664
|
+
description: 'Grant a role to an account (MANAGER=1, OPERATOR=2, AUDITOR=3)',
|
|
665
|
+
inputSchema: {
|
|
666
|
+
type: 'object',
|
|
667
|
+
properties: {
|
|
668
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
669
|
+
account: { type: 'string', description: 'Account address' },
|
|
670
|
+
role: { type: ['string', 'number'], description: 'Role (MANAGER=1, OPERATOR=2, AUDITOR=3)' },
|
|
671
|
+
},
|
|
672
|
+
required: ['treasuryAddress', 'account', 'role'],
|
|
673
|
+
},
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
name: 'treasury_set_budget',
|
|
677
|
+
description: 'Set budget allocation percentages (must sum to 10000 basis points = 100%)',
|
|
678
|
+
inputSchema: {
|
|
679
|
+
type: 'object',
|
|
680
|
+
properties: {
|
|
681
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
682
|
+
opsBps: { type: 'number', description: 'Operations budget (basis points, 0-10000)' },
|
|
683
|
+
growthBps: { type: 'number', description: 'Growth budget (basis points, 0-10000)' },
|
|
684
|
+
reservesBps: { type: 'number', description: 'Reserves budget (basis points, 0-10000)' },
|
|
685
|
+
yieldBps: { type: 'number', description: 'Yield budget (basis points, 0-10000)' },
|
|
686
|
+
},
|
|
687
|
+
required: ['treasuryAddress', 'opsBps', 'growthBps', 'reservesBps', 'yieldBps'],
|
|
688
|
+
},
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
name: 'treasury_set_limit',
|
|
692
|
+
description: 'Set spending limits for an operator',
|
|
693
|
+
inputSchema: {
|
|
694
|
+
type: 'object',
|
|
695
|
+
properties: {
|
|
696
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
697
|
+
operator: { type: 'string', description: 'Operator address' },
|
|
698
|
+
maxPerTx: { type: 'string', description: 'Maximum amount per transaction' },
|
|
699
|
+
maxPerDay: { type: 'string', description: 'Maximum amount per day' },
|
|
700
|
+
},
|
|
701
|
+
required: ['treasuryAddress', 'operator', 'maxPerTx', 'maxPerDay'],
|
|
702
|
+
},
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
name: 'treasury_lookup',
|
|
706
|
+
description: 'Look up treasury address by owner address',
|
|
707
|
+
inputSchema: {
|
|
708
|
+
type: 'object',
|
|
709
|
+
properties: {
|
|
710
|
+
ownerAddress: { type: 'string', description: 'Owner address' },
|
|
711
|
+
},
|
|
712
|
+
required: ['ownerAddress'],
|
|
713
|
+
},
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
name: 'treasury_revoke_role',
|
|
717
|
+
description: 'Revoke role from an account (owner only)',
|
|
718
|
+
inputSchema: {
|
|
719
|
+
type: 'object',
|
|
720
|
+
properties: {
|
|
721
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
722
|
+
account: { type: 'string', description: 'Account address to revoke role from' },
|
|
723
|
+
},
|
|
724
|
+
required: ['treasuryAddress', 'account'],
|
|
725
|
+
},
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
name: 'treasury_set_reserve',
|
|
729
|
+
description: 'Set treasury reserve lock percentage (0-5000 bps = 0-50%)',
|
|
730
|
+
inputSchema: {
|
|
731
|
+
type: 'object',
|
|
732
|
+
properties: {
|
|
733
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
734
|
+
lockBps: { type: 'number', description: 'Reserve lock in basis points (0-5000)', minimum: 0, maximum: 5000 },
|
|
735
|
+
},
|
|
736
|
+
required: ['treasuryAddress', 'lockBps'],
|
|
737
|
+
},
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
name: 'treasury_approve_spender',
|
|
741
|
+
description: 'Approve token spender (admin only)',
|
|
742
|
+
inputSchema: {
|
|
743
|
+
type: 'object',
|
|
744
|
+
properties: {
|
|
745
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
746
|
+
token: { type: 'string', description: 'Token address' },
|
|
747
|
+
spender: { type: 'string', description: 'Spender address' },
|
|
748
|
+
amount: { type: 'string', description: 'Amount to approve' },
|
|
749
|
+
},
|
|
750
|
+
required: ['treasuryAddress', 'token', 'spender', 'amount'],
|
|
751
|
+
},
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
name: 'treasury_set_integration',
|
|
755
|
+
description: 'Set treasury integration contract',
|
|
756
|
+
inputSchema: {
|
|
757
|
+
type: 'object',
|
|
758
|
+
properties: {
|
|
759
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
760
|
+
name: { type: 'string', enum: ['spendingMandate', 'policyRegistry', 'crossRailLedger'], description: 'Integration name' },
|
|
761
|
+
address: { type: 'string', description: 'Integration contract address' },
|
|
762
|
+
},
|
|
763
|
+
required: ['treasuryAddress', 'name', 'address'],
|
|
764
|
+
},
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
name: 'treasury_withdraw_eth',
|
|
768
|
+
description: 'Withdraw ETH from treasury',
|
|
769
|
+
inputSchema: {
|
|
770
|
+
type: 'object',
|
|
771
|
+
properties: {
|
|
772
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
773
|
+
to: { type: 'string', description: 'Recipient address' },
|
|
774
|
+
amount: { type: 'string', description: 'Amount in wei' },
|
|
775
|
+
reason: { type: 'string', description: 'Withdrawal reason' },
|
|
776
|
+
},
|
|
777
|
+
required: ['treasuryAddress', 'to', 'amount', 'reason'],
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
name: 'treasury_spend_limits',
|
|
782
|
+
description: 'Get spend limits for an operator',
|
|
783
|
+
inputSchema: {
|
|
784
|
+
type: 'object',
|
|
785
|
+
properties: {
|
|
786
|
+
treasuryAddress: { type: 'string', description: 'Treasury address' },
|
|
787
|
+
operator: { type: 'string', description: 'Operator address' },
|
|
788
|
+
},
|
|
789
|
+
required: ['treasuryAddress', 'operator'],
|
|
790
|
+
},
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
name: 'agent_profile',
|
|
794
|
+
description: 'Get complete agent profile in one call (identity, reputation, credit, treasury, activity)',
|
|
795
|
+
inputSchema: {
|
|
796
|
+
type: 'object',
|
|
797
|
+
properties: {
|
|
798
|
+
address: { type: 'string', description: 'Ethereum address of the agent' },
|
|
799
|
+
},
|
|
800
|
+
required: ['address'],
|
|
801
|
+
},
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
name: 'quick_pay',
|
|
805
|
+
description: 'Simplified payment with sensible defaults (USDC, auto-release in 7 days)',
|
|
806
|
+
inputSchema: {
|
|
807
|
+
type: 'object',
|
|
808
|
+
properties: {
|
|
809
|
+
to: { type: 'string', description: 'Recipient Ethereum address' },
|
|
810
|
+
amount: { type: 'string', description: 'Amount in USDC (e.g., "100.00")' },
|
|
811
|
+
},
|
|
812
|
+
required: ['to', 'amount'],
|
|
813
|
+
},
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
name: 'ecosystem_status',
|
|
817
|
+
description: 'Health check for all PayLobster contracts and chain info',
|
|
818
|
+
inputSchema: {
|
|
819
|
+
type: 'object',
|
|
820
|
+
properties: {},
|
|
821
|
+
},
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
name: 'agent_search',
|
|
825
|
+
description: 'Search for agents by name, capability, or minimum reputation',
|
|
826
|
+
inputSchema: {
|
|
827
|
+
type: 'object',
|
|
828
|
+
properties: {
|
|
829
|
+
query: { type: 'string', description: 'Search query (name or capability)' },
|
|
830
|
+
capability: { type: 'string', description: 'Filter by specific capability' },
|
|
831
|
+
minReputation: { type: 'number', description: 'Minimum reputation score (0-100)' },
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
name: 'onboard_agent',
|
|
837
|
+
description: 'Get step-by-step onboarding instructions for a new agent',
|
|
838
|
+
inputSchema: {
|
|
839
|
+
type: 'object',
|
|
840
|
+
properties: {
|
|
841
|
+
name: { type: 'string', description: 'Desired agent name' },
|
|
842
|
+
capabilities: { type: 'string', description: 'Comma-separated list of capabilities' },
|
|
843
|
+
},
|
|
844
|
+
required: ['name', 'capabilities'],
|
|
845
|
+
},
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
name: 'create_payment_link',
|
|
849
|
+
description: 'Create a shareable payment link',
|
|
850
|
+
inputSchema: {
|
|
851
|
+
type: 'object',
|
|
852
|
+
properties: {
|
|
853
|
+
amount: { type: 'string', description: 'Amount in tokens' },
|
|
854
|
+
recipient: { type: 'string', description: 'Recipient address' },
|
|
855
|
+
memo: { type: 'string', description: 'Payment memo/description' },
|
|
856
|
+
token: { type: 'string', description: 'Token symbol', default: 'USDC' },
|
|
857
|
+
mode: { type: 'string', enum: ['direct', 'escrow'], default: 'direct' },
|
|
858
|
+
expiresIn: { type: 'number', description: 'Expiration time in seconds' },
|
|
859
|
+
},
|
|
860
|
+
required: ['amount', 'recipient'],
|
|
861
|
+
},
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
name: 'get_payment_link',
|
|
865
|
+
description: 'Get payment link details by code',
|
|
866
|
+
inputSchema: {
|
|
867
|
+
type: 'object',
|
|
868
|
+
properties: {
|
|
869
|
+
code: { type: 'string', description: 'Payment link code' },
|
|
870
|
+
},
|
|
871
|
+
required: ['code'],
|
|
872
|
+
},
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
name: 'list_payment_links',
|
|
876
|
+
description: 'List payment links for a recipient',
|
|
877
|
+
inputSchema: {
|
|
878
|
+
type: 'object',
|
|
879
|
+
properties: {
|
|
880
|
+
recipient: { type: 'string', description: 'Recipient address' },
|
|
881
|
+
},
|
|
882
|
+
required: ['recipient'],
|
|
883
|
+
},
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
name: 'register_webhook',
|
|
887
|
+
description: 'Register a webhook for event notifications',
|
|
888
|
+
inputSchema: {
|
|
889
|
+
type: 'object',
|
|
890
|
+
properties: {
|
|
891
|
+
url: { type: 'string', description: 'Webhook URL' },
|
|
892
|
+
events: { type: 'array', items: { type: 'string' }, description: 'Event types to subscribe to' },
|
|
893
|
+
secret: { type: 'string', description: 'Secret for signature verification' },
|
|
894
|
+
},
|
|
895
|
+
required: ['url', 'events'],
|
|
896
|
+
},
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
name: 'list_webhooks',
|
|
900
|
+
description: 'List all registered webhooks',
|
|
901
|
+
inputSchema: {
|
|
902
|
+
type: 'object',
|
|
903
|
+
properties: {
|
|
904
|
+
address: { type: 'string', description: 'Filter by address' },
|
|
905
|
+
},
|
|
906
|
+
},
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
name: 'get_webhook',
|
|
910
|
+
description: 'Get webhook details by ID',
|
|
911
|
+
inputSchema: {
|
|
912
|
+
type: 'object',
|
|
913
|
+
properties: {
|
|
914
|
+
id: { type: 'string', description: 'Webhook ID' },
|
|
915
|
+
includeSecret: { type: 'boolean', description: 'Include secret in response' },
|
|
916
|
+
},
|
|
917
|
+
required: ['id'],
|
|
918
|
+
},
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
name: 'delete_webhook',
|
|
922
|
+
description: 'Delete a webhook',
|
|
923
|
+
inputSchema: {
|
|
924
|
+
type: 'object',
|
|
925
|
+
properties: {
|
|
926
|
+
id: { type: 'string', description: 'Webhook ID' },
|
|
927
|
+
},
|
|
928
|
+
required: ['id'],
|
|
929
|
+
},
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
name: 'update_webhook',
|
|
933
|
+
description: 'Update a webhook',
|
|
934
|
+
inputSchema: {
|
|
935
|
+
type: 'object',
|
|
936
|
+
properties: {
|
|
937
|
+
id: { type: 'string', description: 'Webhook ID' },
|
|
938
|
+
url: { type: 'string', description: 'New webhook URL' },
|
|
939
|
+
events: { type: 'array', items: { type: 'string' }, description: 'New event list' },
|
|
940
|
+
status: { type: 'string', enum: ['active', 'paused'], description: 'New status' },
|
|
941
|
+
},
|
|
942
|
+
required: ['id'],
|
|
943
|
+
},
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
name: 'request_refund',
|
|
947
|
+
description: 'Request a refund for an escrow',
|
|
948
|
+
inputSchema: {
|
|
949
|
+
type: 'object',
|
|
950
|
+
properties: {
|
|
951
|
+
escrowId: { type: 'number', description: 'Escrow ID' },
|
|
952
|
+
reason: { type: 'string', description: 'Reason for refund' },
|
|
953
|
+
txHash: { type: 'string', description: 'Transaction hash (optional)' },
|
|
954
|
+
},
|
|
955
|
+
required: ['escrowId', 'reason'],
|
|
956
|
+
},
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
name: 'get_refund',
|
|
960
|
+
description: 'Get refund details by ID',
|
|
961
|
+
inputSchema: {
|
|
962
|
+
type: 'object',
|
|
963
|
+
properties: {
|
|
964
|
+
refundId: { type: 'string', description: 'Refund ID' },
|
|
965
|
+
},
|
|
966
|
+
required: ['refundId'],
|
|
967
|
+
},
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
name: 'get_refunds_by_escrow',
|
|
971
|
+
description: 'Get all refunds for an escrow',
|
|
972
|
+
inputSchema: {
|
|
973
|
+
type: 'object',
|
|
974
|
+
properties: {
|
|
975
|
+
escrowId: { type: 'number', description: 'Escrow ID' },
|
|
976
|
+
},
|
|
977
|
+
required: ['escrowId'],
|
|
978
|
+
},
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
name: 'swap_smart',
|
|
982
|
+
description: 'Execute swap with auto-routing (multi-hop if needed). Resolves token symbols, finds best route via 0x + Uniswap V4.',
|
|
983
|
+
inputSchema: {
|
|
984
|
+
type: 'object',
|
|
985
|
+
properties: {
|
|
986
|
+
tokenIn: { type: 'string', description: 'Token to sell (symbol like USDC or 0x address)' },
|
|
987
|
+
tokenOut: { type: 'string', description: 'Token to buy (symbol or 0x address)' },
|
|
988
|
+
amountIn: { type: 'string', description: 'Amount to sell in token units (e.g., "10")' },
|
|
989
|
+
amountUSD: { type: 'number', description: 'Amount in USD to spend (e.g., 10 for $10)' },
|
|
990
|
+
slippage: { type: 'number', description: 'Slippage tolerance (0.005 = 0.5%)', default: 0.005 },
|
|
991
|
+
},
|
|
992
|
+
required: ['tokenIn', 'tokenOut'],
|
|
993
|
+
},
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
name: 'create_price_alert',
|
|
997
|
+
description: 'Set up a price alert for a token. Get notified via webhook or Telegram when price crosses threshold.',
|
|
998
|
+
inputSchema: {
|
|
999
|
+
type: 'object',
|
|
1000
|
+
properties: {
|
|
1001
|
+
tokenAddress: { type: 'string', description: 'Token contract address on Base' },
|
|
1002
|
+
tokenSymbol: { type: 'string', description: 'Token symbol for display' },
|
|
1003
|
+
condition: { type: 'string', enum: ['above', 'below'], description: 'Alert when price goes above or below' },
|
|
1004
|
+
threshold: { type: 'number', description: 'Price threshold in USD' },
|
|
1005
|
+
webhookUrl: { type: 'string', description: 'Webhook URL to call when triggered' },
|
|
1006
|
+
telegramChatId: { type: 'string', description: 'Telegram chat ID for notifications' },
|
|
1007
|
+
},
|
|
1008
|
+
required: ['tokenAddress', 'condition', 'threshold'],
|
|
1009
|
+
},
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
name: 'list_price_alerts',
|
|
1013
|
+
description: 'List all price alerts for the current user',
|
|
1014
|
+
inputSchema: {
|
|
1015
|
+
type: 'object',
|
|
1016
|
+
properties: {
|
|
1017
|
+
activeOnly: { type: 'boolean', description: 'Only show active alerts', default: true },
|
|
1018
|
+
},
|
|
1019
|
+
},
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
name: 'delete_price_alert',
|
|
1023
|
+
description: 'Delete a price alert by ID',
|
|
1024
|
+
inputSchema: {
|
|
1025
|
+
type: 'object',
|
|
1026
|
+
properties: {
|
|
1027
|
+
alertId: { type: 'string', description: 'Alert ID to delete' },
|
|
1028
|
+
},
|
|
1029
|
+
required: ['alertId'],
|
|
1030
|
+
},
|
|
1031
|
+
},
|
|
47
1032
|
],
|
|
48
1033
|
}));
|
|
49
1034
|
// Handle tool calls
|
|
50
1035
|
this.server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
51
1036
|
try {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
case '
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
result = await (0, escrow_js_1.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
1037
|
+
switch (request.params.name) {
|
|
1038
|
+
case 'search_services': {
|
|
1039
|
+
const params = search_js_1.searchServicesSchema.parse(request.params.arguments);
|
|
1040
|
+
const result = await (0, search_js_1.searchServices)(params, this.client);
|
|
1041
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1042
|
+
}
|
|
1043
|
+
case 'create_escrow': {
|
|
1044
|
+
const params = escrow_js_1.createEscrowSchema.parse(request.params.arguments);
|
|
1045
|
+
const result = await (0, escrow_js_1.createEscrow)(params, this.client);
|
|
1046
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1047
|
+
}
|
|
1048
|
+
case 'release_escrow': {
|
|
1049
|
+
const params = escrow_js_1.releaseEscrowSchema.parse(request.params.arguments);
|
|
1050
|
+
const result = await (0, escrow_js_1.releaseEscrow)(params, this.client);
|
|
1051
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1052
|
+
}
|
|
1053
|
+
case 'get_escrow': {
|
|
1054
|
+
const params = escrow_js_1.getEscrowSchema.parse(request.params.arguments);
|
|
1055
|
+
const result = await (0, escrow_js_1.getEscrow)(params, this.client);
|
|
1056
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1057
|
+
}
|
|
1058
|
+
case 'list_escrows': {
|
|
1059
|
+
const params = escrow_js_1.listEscrowsSchema.parse(request.params.arguments);
|
|
1060
|
+
const result = await (0, escrow_js_1.listEscrows)(params, this.client);
|
|
1061
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1062
|
+
}
|
|
1063
|
+
case 'get_reputation': {
|
|
1064
|
+
const params = reputation_js_1.getReputationSchema.parse(request.params.arguments);
|
|
1065
|
+
const result = await (0, reputation_js_1.getReputation)(params, this.client);
|
|
1066
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1067
|
+
}
|
|
1068
|
+
case 'register_agent': {
|
|
1069
|
+
const params = reputation_js_1.registerAgentSchema.parse(request.params.arguments);
|
|
1070
|
+
const result = await (0, reputation_js_1.registerAgent)(params, this.client);
|
|
1071
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1072
|
+
}
|
|
1073
|
+
case 'get_balance': {
|
|
1074
|
+
const params = balance_js_1.getBalanceSchema.parse(request.params.arguments);
|
|
1075
|
+
const result = await (0, balance_js_1.getBalance)(params, this.client);
|
|
1076
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1077
|
+
}
|
|
1078
|
+
case 'create_streaming_payment': {
|
|
1079
|
+
const params = streaming_js_1.createStreamingPaymentSchema.parse(request.params.arguments);
|
|
1080
|
+
const result = await (0, streaming_js_1.createStreamingPayment)(params, this.client);
|
|
1081
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1082
|
+
}
|
|
1083
|
+
case 'cancel_stream': {
|
|
1084
|
+
const params = streaming_js_1.cancelStreamSchema.parse(request.params.arguments);
|
|
1085
|
+
const result = await (0, streaming_js_1.cancelStream)(params, this.client);
|
|
1086
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1087
|
+
}
|
|
1088
|
+
case 'get_stream': {
|
|
1089
|
+
const params = streaming_js_1.getStreamSchema.parse(request.params.arguments);
|
|
1090
|
+
const result = await (0, streaming_js_1.getStream)(params, this.client);
|
|
1091
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1092
|
+
}
|
|
1093
|
+
case 'open_dispute': {
|
|
1094
|
+
const params = disputes_js_1.openDisputeSchema.parse(request.params.arguments);
|
|
1095
|
+
const result = await (0, disputes_js_1.openDispute)(params, this.client);
|
|
1096
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1097
|
+
}
|
|
1098
|
+
case 'submit_evidence': {
|
|
1099
|
+
const params = disputes_js_1.submitEvidenceSchema.parse(request.params.arguments);
|
|
1100
|
+
const result = await (0, disputes_js_1.submitEvidence)(params, this.client);
|
|
1101
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1102
|
+
}
|
|
1103
|
+
case 'get_dispute': {
|
|
1104
|
+
const params = disputes_js_1.getDisputeSchema.parse(request.params.arguments);
|
|
1105
|
+
const result = await (0, disputes_js_1.getDispute)(params, this.client);
|
|
1106
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1107
|
+
}
|
|
1108
|
+
case 'get_credit_score': {
|
|
1109
|
+
const params = credit_js_1.getCreditScoreSchema.parse(request.params.arguments);
|
|
1110
|
+
const result = await (0, credit_js_1.getCreditScore)(params, this.client);
|
|
1111
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1112
|
+
}
|
|
1113
|
+
case 'request_credit_line': {
|
|
1114
|
+
const params = credit_js_1.requestCreditLineSchema.parse(request.params.arguments);
|
|
1115
|
+
const result = await (0, credit_js_1.requestCreditLine)(params, this.client);
|
|
1116
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1117
|
+
}
|
|
1118
|
+
case 'create_cascade': {
|
|
1119
|
+
const params = cascade_js_1.createCascadeSchema.parse(request.params.arguments);
|
|
1120
|
+
const result = await (0, cascade_js_1.createCascade)(params, this.client);
|
|
1121
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1122
|
+
}
|
|
1123
|
+
case 'release_cascade_level': {
|
|
1124
|
+
const params = cascade_js_1.releaseCascadeLevelSchema.parse(request.params.arguments);
|
|
1125
|
+
const result = await (0, cascade_js_1.releaseCascadeLevel)(params, this.client);
|
|
1126
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1127
|
+
}
|
|
1128
|
+
case 'post_intent': {
|
|
1129
|
+
const params = intent_js_1.postIntentSchema.parse(request.params.arguments);
|
|
1130
|
+
const result = await (0, intent_js_1.postIntent)(params, this.client);
|
|
1131
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1132
|
+
}
|
|
1133
|
+
case 'search_intents': {
|
|
1134
|
+
const params = intent_js_1.searchIntentsSchema.parse(request.params.arguments);
|
|
1135
|
+
const result = await (0, intent_js_1.searchIntents)(params, this.client);
|
|
1136
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1137
|
+
}
|
|
1138
|
+
case 'accept_offer': {
|
|
1139
|
+
const params = intent_js_1.acceptOfferSchema.parse(request.params.arguments);
|
|
1140
|
+
const result = await (0, intent_js_1.acceptOffer)(params, this.client);
|
|
1141
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1142
|
+
}
|
|
1143
|
+
case 'create_revenue_share': {
|
|
1144
|
+
const params = revenue_js_1.createRevenueShareSchema.parse(request.params.arguments);
|
|
1145
|
+
const result = await (0, revenue_js_1.createRevenueShare)(params, this.client);
|
|
1146
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1147
|
+
}
|
|
1148
|
+
case 'check_compliance': {
|
|
1149
|
+
const params = compliance_js_1.checkComplianceSchema.parse(request.params.arguments);
|
|
1150
|
+
const result = await (0, compliance_js_1.checkCompliance)(params, this.client);
|
|
1151
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1152
|
+
}
|
|
1153
|
+
case 'trust_endorse': {
|
|
1154
|
+
const params = trust_graph_js_1.endorseAgentSchema.parse(request.params.arguments);
|
|
1155
|
+
const result = await (0, trust_graph_js_1.endorseAgent)(params, this.client);
|
|
1156
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1157
|
+
}
|
|
1158
|
+
case 'trust_revoke': {
|
|
1159
|
+
const params = trust_graph_js_1.revokeEndorsementSchema.parse(request.params.arguments);
|
|
1160
|
+
const result = await (0, trust_graph_js_1.revokeEndorsement)(params, this.client);
|
|
1161
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1162
|
+
}
|
|
1163
|
+
case 'trust_check_direct': {
|
|
1164
|
+
const params = trust_graph_js_1.getDirectTrustSchema.parse(request.params.arguments);
|
|
1165
|
+
const result = await (0, trust_graph_js_1.getDirectTrust)(params, this.client);
|
|
1166
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1167
|
+
}
|
|
1168
|
+
case 'trust_check_inferred': {
|
|
1169
|
+
const params = trust_graph_js_1.getInferredTrustSchema.parse(request.params.arguments);
|
|
1170
|
+
const result = await (0, trust_graph_js_1.getInferredTrust)(params, this.client);
|
|
1171
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1172
|
+
}
|
|
1173
|
+
case 'trust_endorsements': {
|
|
1174
|
+
const params = trust_graph_js_1.getEndorsementsSchema.parse(request.params.arguments);
|
|
1175
|
+
const result = await (0, trust_graph_js_1.getEndorsements)(params, this.client);
|
|
1176
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1177
|
+
}
|
|
1178
|
+
case 'trust_endorsers': {
|
|
1179
|
+
const params = trust_graph_js_1.getEndorsersSchema.parse(request.params.arguments);
|
|
1180
|
+
const result = await (0, trust_graph_js_1.getEndorsers)(params, this.client);
|
|
1181
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1182
|
+
}
|
|
1183
|
+
case 'trust_aggregate': {
|
|
1184
|
+
const params = trust_graph_js_1.getTrustScoreSchema.parse(request.params.arguments);
|
|
1185
|
+
const result = await (0, trust_graph_js_1.getTrustScore)(params, this.client);
|
|
1186
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1187
|
+
}
|
|
1188
|
+
case 'swap_quote': {
|
|
1189
|
+
const params = swap_js_1.swapQuoteSchema.parse(request.params.arguments);
|
|
1190
|
+
const result = await (0, swap_js_1.swapQuote)(params, this.client);
|
|
1191
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1192
|
+
}
|
|
1193
|
+
case 'swap_execute': {
|
|
1194
|
+
const params = swap_js_1.swapExecuteSchema.parse(request.params.arguments);
|
|
1195
|
+
const result = await (0, swap_js_1.swapExecute)(params, this.client);
|
|
1196
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1197
|
+
}
|
|
1198
|
+
case 'swap_tokens': {
|
|
1199
|
+
const params = swap_js_1.swapTokensSchema.parse(request.params.arguments);
|
|
1200
|
+
const result = await (0, swap_js_1.swapTokens)(params, this.client);
|
|
1201
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1202
|
+
}
|
|
1203
|
+
case 'swap_price': {
|
|
1204
|
+
const params = swap_js_1.swapPriceSchema.parse(request.params.arguments);
|
|
1205
|
+
const result = await (0, swap_js_1.swapPrice)(params, this.client);
|
|
1206
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1207
|
+
}
|
|
1208
|
+
case 'bridge_quote': {
|
|
1209
|
+
const params = bridge_js_1.bridgeQuoteSchema.parse(request.params.arguments);
|
|
1210
|
+
const result = await (0, bridge_js_1.bridgeQuote)(params, this.client);
|
|
1211
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1212
|
+
}
|
|
1213
|
+
case 'bridge_execute': {
|
|
1214
|
+
const params = bridge_js_1.bridgeExecuteSchema.parse(request.params.arguments);
|
|
1215
|
+
const result = await (0, bridge_js_1.bridgeExecute)(params, this.client);
|
|
1216
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1217
|
+
}
|
|
1218
|
+
case 'bridge_status': {
|
|
1219
|
+
const params = bridge_js_1.bridgeStatusSchema.parse(request.params.arguments);
|
|
1220
|
+
const result = await (0, bridge_js_1.bridgeStatus)(params, this.client);
|
|
1221
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1222
|
+
}
|
|
1223
|
+
case 'bridge_chains': {
|
|
1224
|
+
const params = bridge_js_1.bridgeChainsSchema.parse(request.params.arguments);
|
|
1225
|
+
const result = await (0, bridge_js_1.bridgeChains)(params, this.client);
|
|
1226
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1227
|
+
}
|
|
1228
|
+
case 'get_portfolio': {
|
|
1229
|
+
const params = portfolio_js_1.getPortfolioSchema.parse(request.params.arguments);
|
|
1230
|
+
const result = await (0, portfolio_js_1.getPortfolio)(params, this.client);
|
|
1231
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1232
|
+
}
|
|
1233
|
+
case 'get_token_price': {
|
|
1234
|
+
const params = portfolio_js_1.getTokenPriceSchema.parse(request.params.arguments);
|
|
1235
|
+
const result = await (0, portfolio_js_1.getTokenPrice)(params, this.client);
|
|
1236
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1237
|
+
}
|
|
1238
|
+
case 'treasury_create': {
|
|
1239
|
+
const params = treasury_js_1.treasuryCreateSchema.parse(request.params.arguments);
|
|
1240
|
+
const result = await (0, treasury_js_1.treasuryCreate)(params, this.client);
|
|
1241
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1242
|
+
}
|
|
1243
|
+
case 'treasury_info': {
|
|
1244
|
+
const params = treasury_js_1.treasuryInfoSchema.parse(request.params.arguments);
|
|
1245
|
+
const result = await (0, treasury_js_1.treasuryInfo)(params, this.client);
|
|
1246
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1247
|
+
}
|
|
1248
|
+
case 'treasury_balances': {
|
|
1249
|
+
const params = treasury_js_1.treasuryBalancesSchema.parse(request.params.arguments);
|
|
1250
|
+
const result = await (0, treasury_js_1.treasuryBalances)(params, this.client);
|
|
1251
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1252
|
+
}
|
|
1253
|
+
case 'treasury_deposit': {
|
|
1254
|
+
const params = treasury_js_1.treasuryDepositSchema.parse(request.params.arguments);
|
|
1255
|
+
const result = await (0, treasury_js_1.treasuryDeposit)(params, this.client);
|
|
1256
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1257
|
+
}
|
|
1258
|
+
case 'treasury_withdraw': {
|
|
1259
|
+
const params = treasury_js_1.treasuryWithdrawSchema.parse(request.params.arguments);
|
|
1260
|
+
const result = await (0, treasury_js_1.treasuryWithdraw)(params, this.client);
|
|
1261
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1262
|
+
}
|
|
1263
|
+
case 'treasury_members': {
|
|
1264
|
+
const params = treasury_js_1.treasuryMembersSchema.parse(request.params.arguments);
|
|
1265
|
+
const result = await (0, treasury_js_1.treasuryMembers)(params, this.client);
|
|
1266
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1267
|
+
}
|
|
1268
|
+
case 'treasury_grant_role': {
|
|
1269
|
+
const params = treasury_js_1.treasuryGrantRoleSchema.parse(request.params.arguments);
|
|
1270
|
+
const result = await (0, treasury_js_1.treasuryGrantRole)(params, this.client);
|
|
1271
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1272
|
+
}
|
|
1273
|
+
case 'treasury_set_budget': {
|
|
1274
|
+
const params = treasury_js_1.treasurySetBudgetSchema.parse(request.params.arguments);
|
|
1275
|
+
const result = await (0, treasury_js_1.treasurySetBudget)(params, this.client);
|
|
1276
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1277
|
+
}
|
|
1278
|
+
case 'treasury_set_limit': {
|
|
1279
|
+
const params = treasury_js_1.treasurySetLimitSchema.parse(request.params.arguments);
|
|
1280
|
+
const result = await (0, treasury_js_1.treasurySetLimit)(params, this.client);
|
|
1281
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1282
|
+
}
|
|
1283
|
+
case 'treasury_lookup': {
|
|
1284
|
+
const params = treasury_js_1.treasuryLookupSchema.parse(request.params.arguments);
|
|
1285
|
+
const result = await (0, treasury_js_1.treasuryLookup)(params, this.client);
|
|
1286
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1287
|
+
}
|
|
1288
|
+
case 'treasury_revoke_role': {
|
|
1289
|
+
const params = treasury_js_1.treasuryRevokeRoleSchema.parse(request.params.arguments);
|
|
1290
|
+
const result = await (0, treasury_js_1.treasuryRevokeRole)(params, this.client);
|
|
1291
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1292
|
+
}
|
|
1293
|
+
case 'treasury_set_reserve': {
|
|
1294
|
+
const params = treasury_js_1.treasurySetReserveSchema.parse(request.params.arguments);
|
|
1295
|
+
const result = await (0, treasury_js_1.treasurySetReserve)(params, this.client);
|
|
1296
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1297
|
+
}
|
|
1298
|
+
case 'treasury_approve_spender': {
|
|
1299
|
+
const params = treasury_js_1.treasuryApproveSpenderSchema.parse(request.params.arguments);
|
|
1300
|
+
const result = await (0, treasury_js_1.treasuryApproveSpender)(params, this.client);
|
|
1301
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1302
|
+
}
|
|
1303
|
+
case 'treasury_set_integration': {
|
|
1304
|
+
const params = treasury_js_1.treasurySetIntegrationSchema.parse(request.params.arguments);
|
|
1305
|
+
const result = await (0, treasury_js_1.treasurySetIntegration)(params, this.client);
|
|
1306
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1307
|
+
}
|
|
1308
|
+
case 'treasury_withdraw_eth': {
|
|
1309
|
+
const params = treasury_js_1.treasuryWithdrawEthSchema.parse(request.params.arguments);
|
|
1310
|
+
const result = await (0, treasury_js_1.treasuryWithdrawEth)(params, this.client);
|
|
1311
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1312
|
+
}
|
|
1313
|
+
case 'treasury_spend_limits': {
|
|
1314
|
+
const params = treasury_js_1.treasurySpendLimitsSchema.parse(request.params.arguments);
|
|
1315
|
+
const result = await (0, treasury_js_1.treasurySpendLimits)(params, this.client);
|
|
1316
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1317
|
+
}
|
|
1318
|
+
case 'investment_propose': {
|
|
1319
|
+
const params = investment_js_1.investmentProposeSchema.parse(request.params.arguments);
|
|
1320
|
+
const result = await (0, investment_js_1.investmentPropose)(params, this.client);
|
|
1321
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1322
|
+
}
|
|
1323
|
+
case 'investment_fund': {
|
|
1324
|
+
const params = investment_js_1.investmentFundSchema.parse(request.params.arguments);
|
|
1325
|
+
const result = await (0, investment_js_1.investmentFund)(params, this.client);
|
|
1326
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1327
|
+
}
|
|
1328
|
+
case 'investment_claim': {
|
|
1329
|
+
const params = investment_js_1.investmentClaimSchema.parse(request.params.arguments);
|
|
1330
|
+
const result = await (0, investment_js_1.investmentClaim)(params, this.client);
|
|
1331
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1332
|
+
}
|
|
1333
|
+
case 'investment_milestone': {
|
|
1334
|
+
const params = investment_js_1.investmentMilestoneSchema.parse(request.params.arguments);
|
|
1335
|
+
const result = await (0, investment_js_1.investmentMilestone)(params, this.client);
|
|
1336
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1337
|
+
}
|
|
1338
|
+
case 'investment_default': {
|
|
1339
|
+
const params = investment_js_1.investmentDefaultSchema.parse(request.params.arguments);
|
|
1340
|
+
const result = await (0, investment_js_1.investmentDefault)(params, this.client);
|
|
1341
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1342
|
+
}
|
|
1343
|
+
case 'investment_cancel': {
|
|
1344
|
+
const params = investment_js_1.investmentCancelSchema.parse(request.params.arguments);
|
|
1345
|
+
const result = await (0, investment_js_1.investmentCancel)(params, this.client);
|
|
1346
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1347
|
+
}
|
|
1348
|
+
case 'investment_info': {
|
|
1349
|
+
const params = investment_js_1.investmentInfoSchema.parse(request.params.arguments);
|
|
1350
|
+
const result = await (0, investment_js_1.investmentInfo)(params, this.client);
|
|
1351
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1352
|
+
}
|
|
1353
|
+
case 'investment_portfolio': {
|
|
1354
|
+
const params = investment_js_1.investmentPortfolioSchema.parse(request.params.arguments);
|
|
1355
|
+
const result = await (0, investment_js_1.investmentPortfolio)(params, this.client);
|
|
1356
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1357
|
+
}
|
|
1358
|
+
case 'investment_treasury': {
|
|
1359
|
+
const params = investment_js_1.investmentTreasurySchema.parse(request.params.arguments);
|
|
1360
|
+
const result = await (0, investment_js_1.investmentTreasury)(params, this.client);
|
|
1361
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1362
|
+
}
|
|
1363
|
+
case 'investment_stats': {
|
|
1364
|
+
const params = investment_js_1.investmentStatsSchema.parse(request.params.arguments);
|
|
1365
|
+
const result = await (0, investment_js_1.investmentStats)(params, this.client);
|
|
1366
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1367
|
+
}
|
|
1368
|
+
case 'agent_profile': {
|
|
1369
|
+
const params = convenience_js_1.agentProfileSchema.parse(request.params.arguments);
|
|
1370
|
+
const result = await (0, convenience_js_1.agentProfile)(params, this.client);
|
|
1371
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1372
|
+
}
|
|
1373
|
+
case 'quick_pay': {
|
|
1374
|
+
const params = convenience_js_1.quickPaySchema.parse(request.params.arguments);
|
|
1375
|
+
const result = await (0, convenience_js_1.quickPay)(params, this.client);
|
|
1376
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1377
|
+
}
|
|
1378
|
+
case 'ecosystem_status': {
|
|
1379
|
+
const params = convenience_js_1.ecosystemStatusSchema.parse(request.params.arguments);
|
|
1380
|
+
const result = await (0, convenience_js_1.ecosystemStatus)(params, this.client);
|
|
1381
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1382
|
+
}
|
|
1383
|
+
case 'agent_search': {
|
|
1384
|
+
const params = convenience_js_1.agentSearchSchema.parse(request.params.arguments);
|
|
1385
|
+
const result = await (0, convenience_js_1.agentSearch)(params, this.client);
|
|
1386
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1387
|
+
}
|
|
1388
|
+
case 'onboard_agent': {
|
|
1389
|
+
const params = convenience_js_1.onboardAgentSchema.parse(request.params.arguments);
|
|
1390
|
+
const result = await (0, convenience_js_1.onboardAgent)(params, this.client);
|
|
1391
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1392
|
+
}
|
|
1393
|
+
case 'create_payment_link': {
|
|
1394
|
+
const params = links_js_1.createPaymentLinkSchema.parse(request.params.arguments);
|
|
1395
|
+
const result = await (0, links_js_1.createPaymentLink)(params);
|
|
1396
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1397
|
+
}
|
|
1398
|
+
case 'get_payment_link': {
|
|
1399
|
+
const params = links_js_1.getPaymentLinkSchema.parse(request.params.arguments);
|
|
1400
|
+
const result = await (0, links_js_1.getPaymentLink)(params);
|
|
1401
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1402
|
+
}
|
|
1403
|
+
case 'list_payment_links': {
|
|
1404
|
+
const params = links_js_1.listPaymentLinksSchema.parse(request.params.arguments);
|
|
1405
|
+
const result = await (0, links_js_1.listPaymentLinks)(params);
|
|
1406
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1407
|
+
}
|
|
1408
|
+
case 'register_webhook': {
|
|
1409
|
+
const params = webhooks_js_1.registerWebhookSchema.parse(request.params.arguments);
|
|
1410
|
+
const result = await (0, webhooks_js_1.registerWebhook)(params);
|
|
1411
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1412
|
+
}
|
|
1413
|
+
case 'list_webhooks': {
|
|
1414
|
+
const params = webhooks_js_1.listWebhooksSchema.parse(request.params.arguments);
|
|
1415
|
+
const result = await (0, webhooks_js_1.listWebhooks)(params);
|
|
1416
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1417
|
+
}
|
|
1418
|
+
case 'get_webhook': {
|
|
1419
|
+
const params = webhooks_js_1.getWebhookSchema.parse(request.params.arguments);
|
|
1420
|
+
const result = await (0, webhooks_js_1.getWebhook)(params);
|
|
1421
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1422
|
+
}
|
|
1423
|
+
case 'delete_webhook': {
|
|
1424
|
+
const params = webhooks_js_1.deleteWebhookSchema.parse(request.params.arguments);
|
|
1425
|
+
const result = await (0, webhooks_js_1.deleteWebhook)(params);
|
|
1426
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1427
|
+
}
|
|
1428
|
+
case 'update_webhook': {
|
|
1429
|
+
const params = webhooks_js_1.updateWebhookSchema.parse(request.params.arguments);
|
|
1430
|
+
const result = await (0, webhooks_js_1.updateWebhook)(params);
|
|
1431
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1432
|
+
}
|
|
1433
|
+
case 'request_refund': {
|
|
1434
|
+
const params = refunds_js_1.requestRefundSchema.parse(request.params.arguments);
|
|
1435
|
+
const result = await (0, refunds_js_1.requestRefund)(params);
|
|
1436
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1437
|
+
}
|
|
1438
|
+
case 'get_refund': {
|
|
1439
|
+
const params = refunds_js_1.getRefundSchema.parse(request.params.arguments);
|
|
1440
|
+
const result = await (0, refunds_js_1.getRefund)(params);
|
|
1441
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1442
|
+
}
|
|
1443
|
+
case 'get_refunds_by_escrow': {
|
|
1444
|
+
const params = refunds_js_1.getRefundsByEscrowSchema.parse(request.params.arguments);
|
|
1445
|
+
const result = await (0, refunds_js_1.getRefundsByEscrow)(params);
|
|
1446
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1447
|
+
}
|
|
1448
|
+
case 'swap_smart': {
|
|
1449
|
+
const params = swap_smart_js_1.swapSmartSchema.parse(request.params.arguments);
|
|
1450
|
+
const result = await (0, swap_smart_js_1.swapSmart)(params, this.client);
|
|
1451
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1452
|
+
}
|
|
1453
|
+
case 'create_price_alert': {
|
|
1454
|
+
const params = price_alerts_js_1.createPriceAlertSchema.parse(request.params.arguments);
|
|
1455
|
+
const result = await (0, price_alerts_js_1.createPriceAlert)(params, this.client);
|
|
1456
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1457
|
+
}
|
|
1458
|
+
case 'list_price_alerts': {
|
|
1459
|
+
const params = price_alerts_js_1.listPriceAlertsSchema.parse(request.params.arguments);
|
|
1460
|
+
const result = await (0, price_alerts_js_1.listPriceAlerts)(params, this.client);
|
|
1461
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1462
|
+
}
|
|
1463
|
+
case 'delete_price_alert': {
|
|
1464
|
+
const params = price_alerts_js_1.deletePriceAlertSchema.parse(request.params.arguments);
|
|
1465
|
+
const result = await (0, price_alerts_js_1.deletePriceAlert)(params, this.client);
|
|
1466
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
1467
|
+
}
|
|
73
1468
|
default:
|
|
74
|
-
throw {
|
|
75
|
-
code: 'ERR_UNKNOWN_TOOL',
|
|
76
|
-
message: `Unknown tool: ${name}`,
|
|
77
|
-
retryable: false,
|
|
78
|
-
};
|
|
1469
|
+
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
79
1470
|
}
|
|
80
|
-
return {
|
|
81
|
-
content: [
|
|
82
|
-
{
|
|
83
|
-
type: 'text',
|
|
84
|
-
text: JSON.stringify(result, null, 2),
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
};
|
|
88
1471
|
}
|
|
89
1472
|
catch (error) {
|
|
1473
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
90
1474
|
return {
|
|
91
|
-
content: [
|
|
92
|
-
{
|
|
93
|
-
type: 'text',
|
|
94
|
-
text: JSON.stringify({
|
|
95
|
-
error: {
|
|
96
|
-
code: error.code || 'ERR_UNKNOWN',
|
|
97
|
-
message: error.message || 'An unknown error occurred',
|
|
98
|
-
details: error.details,
|
|
99
|
-
retryable: error.retryable ?? false,
|
|
100
|
-
},
|
|
101
|
-
}, null, 2),
|
|
102
|
-
},
|
|
103
|
-
],
|
|
1475
|
+
content: [{ type: 'text', text: `Error: ${errorMessage}` }],
|
|
104
1476
|
isError: true,
|
|
105
1477
|
};
|
|
106
1478
|
}
|
|
107
1479
|
});
|
|
108
1480
|
// List available resources
|
|
109
1481
|
this.server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async () => ({
|
|
110
|
-
resources:
|
|
111
|
-
{
|
|
112
|
-
uri: 'paylobster://services',
|
|
113
|
-
name: 'Service Catalog',
|
|
114
|
-
description: 'Browse all available AI agent services',
|
|
115
|
-
mimeType: 'application/json',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
uri: 'paylobster://agent/{address}',
|
|
119
|
-
name: 'Agent Profile',
|
|
120
|
-
description: 'Get agent identity and reputation by address',
|
|
121
|
-
mimeType: 'application/json',
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
uri: 'paylobster://escrow/{id}',
|
|
125
|
-
name: 'Escrow Details',
|
|
126
|
-
description: 'Get details for a specific escrow',
|
|
127
|
-
mimeType: 'application/json',
|
|
128
|
-
},
|
|
129
|
-
],
|
|
1482
|
+
resources: (0, index_js_2.listResources)(),
|
|
130
1483
|
}));
|
|
131
|
-
//
|
|
1484
|
+
// Read resource
|
|
132
1485
|
this.server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request) => {
|
|
133
1486
|
try {
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if (escrowMatch) {
|
|
144
|
-
return await (0, escrow_js_2.getEscrowResource)(escrowMatch[1], this.contracts);
|
|
145
|
-
}
|
|
146
|
-
throw {
|
|
147
|
-
code: 'ERR_RESOURCE_NOT_FOUND',
|
|
148
|
-
message: `Unknown resource URI: ${uri}`,
|
|
149
|
-
retryable: false,
|
|
1487
|
+
const result = await (0, index_js_2.handleResource)(request.params.uri, this.client);
|
|
1488
|
+
return {
|
|
1489
|
+
contents: [
|
|
1490
|
+
{
|
|
1491
|
+
uri: request.params.uri,
|
|
1492
|
+
mimeType: 'application/json',
|
|
1493
|
+
text: JSON.stringify(result, null, 2),
|
|
1494
|
+
},
|
|
1495
|
+
],
|
|
150
1496
|
};
|
|
151
1497
|
}
|
|
152
1498
|
catch (error) {
|
|
153
|
-
|
|
1499
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1500
|
+
throw new Error(`Failed to read resource: ${errorMessage}`);
|
|
154
1501
|
}
|
|
155
1502
|
});
|
|
156
1503
|
}
|
|
157
1504
|
async start() {
|
|
158
1505
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
159
1506
|
await this.server.connect(transport);
|
|
160
|
-
|
|
161
|
-
console.error('PayLobster MCP Server started');
|
|
162
|
-
console.error(`Network: ${this.config.network}`);
|
|
163
|
-
console.error(`RPC URL: ${this.config.rpcUrl}`);
|
|
164
|
-
}
|
|
165
|
-
getServer() {
|
|
166
|
-
return this.server;
|
|
1507
|
+
console.error('PayLobster MCP server running on stdio');
|
|
167
1508
|
}
|
|
168
1509
|
}
|
|
169
1510
|
exports.PayLobsterMCPServer = PayLobsterMCPServer;
|