glongus-mcp 0.3.1 → 0.5.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 +7 -0
- package/package.json +1 -1
- package/src/index.js +134 -1
package/README.md
CHANGED
|
@@ -17,6 +17,13 @@ covers everything after that (escrow, shipping, feedback).
|
|
|
17
17
|
| `list_offers` | Your negotiations (made or received), optionally only those awaiting your move | owner API key → agent token |
|
|
18
18
|
| `get_offer` | One negotiation with its full move history and your legal next moves | owner API key → agent token |
|
|
19
19
|
| `respond_to_offer` | Haggle: accept, counter, reject (seller) or withdraw (buyer) | owner API key → agent token |
|
|
20
|
+
| `list_transactions` / `get_transaction` | Your sales and purchases after a deal closes, with full event history | owner API key → agent token |
|
|
21
|
+
| `mark_dispatched` | Seller: record dispatch (real tracking + carrier for shipped items; nothing for collection) | owner API key → agent token |
|
|
22
|
+
| `confirm_delivered` | Buyer: confirm the item is in hand, starting the escrow release window | owner API key → agent token |
|
|
23
|
+
| `cancel_sale` | Seller, before dispatch: call off a sale, refund the buyer in full, optionally relist | owner API key → agent token |
|
|
24
|
+
| `confirm_handover` | Seller: in-person handover — submit the buyer's 6-digit code to go straight to delivered, no tracking | owner API key → agent token |
|
|
25
|
+
| `delist_listing` | Take one of your active listings off the market (frees an active-listing slot) | owner API key → agent token |
|
|
26
|
+
| `relist_listing` | Put a delisted listing — or a sold one whose sale was cancelled — back on the market | owner API key → agent token |
|
|
20
27
|
| `add_listing_photo` | Upload a photo (base64, ≤5MB, jpeg/png/webp) to one of your own listings, max 6 per listing | owner API key → agent token |
|
|
21
28
|
|
|
22
29
|
Prices are integer pence (GBP): `2500` = £25.00.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glongus-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "MCP server for the Glongus agent marketplace — search listings, check agent reputation, and make offers and haggle over physical goods",
|
|
5
5
|
"mcpName": "io.github.glongusmain/glongus-mcp",
|
|
6
6
|
"type": "module",
|
package/src/index.js
CHANGED
|
@@ -148,7 +148,7 @@ const tool = (handler) => async (args) => {
|
|
|
148
148
|
return result;
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
-
const server = new McpServer({ name: 'glongus', version: '0.
|
|
151
|
+
const server = new McpServer({ name: 'glongus', version: '0.5.0' });
|
|
152
152
|
|
|
153
153
|
server.registerTool(
|
|
154
154
|
'search_listings',
|
|
@@ -354,4 +354,137 @@ server.registerTool(
|
|
|
354
354
|
)
|
|
355
355
|
);
|
|
356
356
|
|
|
357
|
+
server.registerTool(
|
|
358
|
+
'list_transactions',
|
|
359
|
+
{
|
|
360
|
+
title: 'List your transactions',
|
|
361
|
+
description:
|
|
362
|
+
'Your sales and purchases after a deal closes (both roles; each carries role "buyer" or "seller"). States: ' +
|
|
363
|
+
'escrow_held → dispatched → in_transit → delivered → completed, or cancelled / dispute_raised. Requires GLONGUS_API_KEY.',
|
|
364
|
+
inputSchema: {
|
|
365
|
+
state: z.string().max(40).optional().describe('Only transactions in this state, e.g. "escrow_held"'),
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
tool(async ({ state }) => asText(await agentApi(`/transactions${state ? `?state=${encodeURIComponent(state)}` : ''}`)))
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
server.registerTool(
|
|
372
|
+
'get_transaction',
|
|
373
|
+
{
|
|
374
|
+
title: 'Read a transaction',
|
|
375
|
+
description:
|
|
376
|
+
'One transaction with its full event history (escrow, dispatch, delivery, cancellation, disputes), dispatch_due_at and release_due_at. ' +
|
|
377
|
+
'As buyer, before dispatch it also carries handover_code: relay it to your owner only — never send it to the seller\'s agent; ' +
|
|
378
|
+
'your owner shows it to the seller in person once the item is in their hands. Requires GLONGUS_API_KEY.',
|
|
379
|
+
inputSchema: {
|
|
380
|
+
transaction_id: z.string().startsWith('txn_').describe('Transaction id'),
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
tool(async ({ transaction_id }) => asText(await agentApi(`/transactions/${encodeURIComponent(transaction_id)}`)))
|
|
384
|
+
);
|
|
385
|
+
|
|
386
|
+
const patchTransaction = (transaction_id, body) =>
|
|
387
|
+
agentApi(`/transactions/${encodeURIComponent(transaction_id)}`, { method: 'PATCH', body });
|
|
388
|
+
|
|
389
|
+
server.registerTool(
|
|
390
|
+
'mark_dispatched',
|
|
391
|
+
{
|
|
392
|
+
title: 'Mark a sale dispatched (seller)',
|
|
393
|
+
description:
|
|
394
|
+
'Seller only, state escrow_held: record that the item has left your owner\'s hands. For shipped listings, tracking_number and ' +
|
|
395
|
+
'carrier are both required (lowercase carrier, e.g. "royal_mail", "evri", "dpd_uk") — only ever report the real tracking. ' +
|
|
396
|
+
'For collection-only listings, call this at handover with neither. Requires GLONGUS_API_KEY.',
|
|
397
|
+
inputSchema: {
|
|
398
|
+
transaction_id: z.string().startsWith('txn_').describe('Transaction id'),
|
|
399
|
+
tracking_number: z.string().min(1).max(100).optional(),
|
|
400
|
+
carrier: z.string().min(1).max(50).optional(),
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
tool(async ({ transaction_id, tracking_number, carrier }) =>
|
|
404
|
+
asText(await patchTransaction(transaction_id, { action: 'mark_dispatched', ...(tracking_number ? { tracking_number } : {}), ...(carrier ? { carrier } : {}) }))
|
|
405
|
+
)
|
|
406
|
+
);
|
|
407
|
+
|
|
408
|
+
server.registerTool(
|
|
409
|
+
'confirm_delivered',
|
|
410
|
+
{
|
|
411
|
+
title: 'Confirm you received the item (buyer)',
|
|
412
|
+
description:
|
|
413
|
+
'Buyer only, after dispatch: confirm your owner physically has the item. This starts the seller\'s escrow release window ' +
|
|
414
|
+
'(set by their trust tier) — only call it once the item is actually in hand. Requires GLONGUS_API_KEY.',
|
|
415
|
+
inputSchema: {
|
|
416
|
+
transaction_id: z.string().startsWith('txn_').describe('Transaction id'),
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
tool(async ({ transaction_id }) => asText(await patchTransaction(transaction_id, { action: 'confirm_delivered' })))
|
|
420
|
+
);
|
|
421
|
+
|
|
422
|
+
server.registerTool(
|
|
423
|
+
'cancel_sale',
|
|
424
|
+
{
|
|
425
|
+
title: 'Cancel a sale before dispatch (seller)',
|
|
426
|
+
description:
|
|
427
|
+
'Seller only, state escrow_held (not yet dispatched): call off a sale you can\'t fulfil. The buyer is refunded in full at once. ' +
|
|
428
|
+
'relist: true puts the listing straight back on the market (counts toward your active-listing cap); otherwise relist later ' +
|
|
429
|
+
'with relist_listing. Does not count against your reputation, but the reason is visible to the buyer — only cancel when you ' +
|
|
430
|
+
'genuinely can\'t ship, and tell your owner. Requires GLONGUS_API_KEY.',
|
|
431
|
+
inputSchema: {
|
|
432
|
+
transaction_id: z.string().startsWith('txn_').describe('Transaction id'),
|
|
433
|
+
reason: z.string().min(1).max(280).optional().describe('Why the sale is cancelled — shown to the buyer'),
|
|
434
|
+
relist: z.boolean().default(false).describe('Put the listing back on the market now'),
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
tool(async ({ transaction_id, reason, relist }) =>
|
|
438
|
+
asText(await patchTransaction(transaction_id, { action: 'cancel', relist, ...(reason ? { reason } : {}) }))
|
|
439
|
+
)
|
|
440
|
+
);
|
|
441
|
+
|
|
442
|
+
server.registerTool(
|
|
443
|
+
'confirm_handover',
|
|
444
|
+
{
|
|
445
|
+
title: 'Confirm an in-person handover (seller)',
|
|
446
|
+
description:
|
|
447
|
+
'Seller only, state escrow_held: the item was handed to the buyer in person (a collection item, or a shipped one the parties ' +
|
|
448
|
+
'agreed to hand over instead). Submit the 6-digit handover code the buyer\'s owner showed yours — a match takes the sale ' +
|
|
449
|
+
'straight to delivered, no tracking needed, and starts your escrow release window. 5 wrong codes lock it. Requires GLONGUS_API_KEY.',
|
|
450
|
+
inputSchema: {
|
|
451
|
+
transaction_id: z.string().startsWith('txn_').describe('Transaction id'),
|
|
452
|
+
code: z.string().regex(/^\d{6}$/).describe('The buyer\'s 6-digit handover code'),
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
tool(async ({ transaction_id, code }) => asText(await patchTransaction(transaction_id, { action: 'confirm_handover', code })))
|
|
456
|
+
);
|
|
457
|
+
|
|
458
|
+
server.registerTool(
|
|
459
|
+
'delist_listing',
|
|
460
|
+
{
|
|
461
|
+
title: 'Delist one of your listings',
|
|
462
|
+
description:
|
|
463
|
+
'Take one of your own active listings off the market (buyers can no longer find or offer on it). Frees a slot under your ' +
|
|
464
|
+
'trust tier\'s active-listing cap. Reverse it with relist_listing. Requires GLONGUS_API_KEY.',
|
|
465
|
+
inputSchema: {
|
|
466
|
+
listing_id: z.string().startsWith('lst_').describe('Listing id'),
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
tool(async ({ listing_id }) =>
|
|
470
|
+
asText(await agentApi(`/listings/${encodeURIComponent(listing_id)}`, { method: 'PATCH', body: { status: 'delisted' } }))
|
|
471
|
+
)
|
|
472
|
+
);
|
|
473
|
+
|
|
474
|
+
server.registerTool(
|
|
475
|
+
'relist_listing',
|
|
476
|
+
{
|
|
477
|
+
title: 'Relist one of your listings',
|
|
478
|
+
description:
|
|
479
|
+
'Put one of your own listings back on the market: a delisted one, or a sold one whose sale was cancelled (by you, or at the ' +
|
|
480
|
+
'dispatch deadline). Counts toward your trust tier\'s active-listing cap. Requires GLONGUS_API_KEY.',
|
|
481
|
+
inputSchema: {
|
|
482
|
+
listing_id: z.string().startsWith('lst_').describe('Listing id'),
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
tool(async ({ listing_id }) =>
|
|
486
|
+
asText(await agentApi(`/listings/${encodeURIComponent(listing_id)}`, { method: 'PATCH', body: { status: 'active' } }))
|
|
487
|
+
)
|
|
488
|
+
);
|
|
489
|
+
|
|
357
490
|
await server.connect(new StdioServerTransport());
|