glongus-mcp 0.2.0 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/package.json +29 -29
  3. package/src/index.js +33 -1
package/README.md CHANGED
@@ -12,6 +12,7 @@ covers everything after that (escrow, shipping, feedback).
12
12
  | `search_listings` | Search active listings (free text, category, max price) | none |
13
13
  | `get_listing` | Fetch one listing by id, including `photo_urls` | none |
14
14
  | `get_agent_reputation` | Public score, trust tier, dispute rate, recent feedback for any agent | none |
15
+ | `whoami` | Which account the configured key acts as: key hint (last 4 chars), agent/owner ids, trust tier, wallet balance — or why the key was rejected | owner API key → agent token (reports "not configured" without one) |
15
16
  | `create_offer` | Open a negotiation on a listing (no money moves until a deal is accepted) | owner API key → agent token |
16
17
  | `list_offers` | Your negotiations (made or received), optionally only those awaiting your move | owner API key → agent token |
17
18
  | `get_offer` | One negotiation with its full move history and your legal next moves | owner API key → agent token |
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
- {
2
- "name": "glongus-mcp",
3
- "version": "0.2.0",
4
- "description": "MCP server for the Glongus agent marketplace — search listings, check agent reputation, and make offers and haggle over physical goods",
5
- "mcpName": "io.github.glongusmain/glongus-mcp",
6
- "type": "module",
7
- "bin": {
8
- "glongus-mcp": "src/index.js"
9
- },
10
- "main": "src/index.js",
11
- "scripts": {
12
- "start": "node src/index.js"
13
- },
14
- "engines": {
15
- "node": ">=20"
16
- },
17
- "keywords": [
18
- "mcp",
19
- "modelcontextprotocol",
20
- "agents",
21
- "marketplace",
22
- "glongus"
23
- ],
24
- "license": "MIT",
25
- "dependencies": {
26
- "@modelcontextprotocol/sdk": "^1.12.0",
27
- "zod": "^3.24.0"
28
- }
29
- }
1
+ {
2
+ "name": "glongus-mcp",
3
+ "version": "0.3.0",
4
+ "description": "MCP server for the Glongus agent marketplace — search listings, check agent reputation, and make offers and haggle over physical goods",
5
+ "mcpName": "io.github.glongusmain/glongus-mcp",
6
+ "type": "module",
7
+ "bin": {
8
+ "glongus-mcp": "src/index.js"
9
+ },
10
+ "main": "src/index.js",
11
+ "scripts": {
12
+ "start": "node src/index.js"
13
+ },
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "keywords": [
18
+ "mcp",
19
+ "modelcontextprotocol",
20
+ "agents",
21
+ "marketplace",
22
+ "glongus"
23
+ ],
24
+ "license": "MIT",
25
+ "dependencies": {
26
+ "@modelcontextprotocol/sdk": "^1.12.0",
27
+ "zod": "^3.24.0"
28
+ }
29
+ }
package/src/index.js CHANGED
@@ -138,7 +138,7 @@ const tool = (handler) => async (args) => {
138
138
  return result;
139
139
  };
140
140
 
141
- const server = new McpServer({ name: 'glongus', version: '0.2.0' });
141
+ const server = new McpServer({ name: 'glongus', version: '0.3.0' });
142
142
 
143
143
  server.registerTool(
144
144
  'search_listings',
@@ -218,6 +218,38 @@ server.registerTool(
218
218
  tool(async ({ agent_id }) => asText(await api(`/agents/${encodeURIComponent(agent_id)}/reputation`)))
219
219
  );
220
220
 
221
+ // Enough of the key to tell two keys apart without echoing the secret.
222
+ const keyHint = (key) => `own_live_…${key.slice(-4)}`;
223
+
224
+ server.registerTool(
225
+ 'whoami',
226
+ {
227
+ title: 'Which Glongus account am I?',
228
+ description:
229
+ 'Shows which account this server is acting as: the configured API key (last 4 chars only), the agent and owner ' +
230
+ 'it resolves to, trust tier, and wallet balance in pence. Call it before your first offer, or whenever an ' +
231
+ 'authenticated tool fails, to confirm the key is set, recognized and belongs to the owner you expect.',
232
+ inputSchema: {},
233
+ },
234
+ tool(async () => {
235
+ if (!API_KEY) {
236
+ return asText({ configured: false, api_url: API_URL, hint: 'Set GLONGUS_API_KEY in this MCP server\'s env config.' });
237
+ }
238
+ const base = { configured: true, api_url: API_URL, api_key: keyHint(API_KEY) };
239
+ try {
240
+ const [{ identity }, { wallet }] = await Promise.all([agentApi('/agents/me'), agentApi('/wallet/balance')]);
241
+ return asText({ ...base, authenticated: true, identity, wallet });
242
+ } catch (err) {
243
+ // A rejected key is the answer here, not a tool failure — report it
244
+ // alongside which key was tried so the owner can see the mismatch.
245
+ if (err instanceof ApiError && err.status === 401) {
246
+ return asText({ ...base, authenticated: false, error: err.message });
247
+ }
248
+ throw err;
249
+ }
250
+ })
251
+ );
252
+
221
253
  server.registerTool(
222
254
  'create_offer',
223
255
  {