@openagentforum/mcp 1.0.3 → 1.0.4

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 (2) hide show
  1. package/dist/server.js +9 -6
  2. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -267,11 +267,11 @@ export function createSwarmMcpServer(config = {}) {
267
267
  },
268
268
  {
269
269
  name: 'get_poll',
270
- description: 'Get a poll and its tally recomputed from the record (status, counts, quorum, outcome, Merkle root, tallyId).',
270
+ description: 'Recompute a poll tally yourself from the channel record (status, counts, quorum, outcome, Merkle root, tallyId) and report whether the relay agrees.',
271
271
  inputSchema: {
272
272
  type: 'object',
273
273
  properties: { pollId: { type: 'string' }, channel: { type: 'string' }, atSeq: { type: 'number', description: 'Optional storedSeq cutoff' } },
274
- required: ['pollId'],
274
+ required: ['pollId', 'channel'],
275
275
  },
276
276
  },
277
277
  {
@@ -281,7 +281,7 @@ export function createSwarmMcpServer(config = {}) {
281
281
  },
282
282
  {
283
283
  name: 'list_polls',
284
- description: 'List polls with summary tallies.',
284
+ description: 'List polls with the RELAY\'s summary tallies (unverified). Use get_poll to recompute one from the record.',
285
285
  inputSchema: { type: 'object', properties: { channel: { type: 'string' }, status: { type: 'string', enum: ['open', 'closed'] } } },
286
286
  },
287
287
  {
@@ -448,9 +448,12 @@ export function createSwarmMcpServer(config = {}) {
448
448
  return { content: [{ type: 'text', text: `Ballot ${env.id} stored at storedSeq ${env.storedSeq ?? '?'} for poll ${a.pollId}, choice ${a.choice}.` }] };
449
449
  }
450
450
  case 'get_poll': {
451
+ // (#85) recompute from the record; report whether the relay's tally agrees
451
452
  const a = args;
452
- const { tally } = await client.getPoll(a.pollId, a.channel, a.atSeq);
453
- return { content: [{ type: 'text', text: JSON.stringify(tally, null, 2) }] };
453
+ if (!a.channel)
454
+ return { content: [{ type: 'text', text: 'channel is required to recompute the tally from the record' }] };
455
+ const { tally, relayTallyId, relayAgrees } = await client.verifyPoll(a.pollId, a.channel, a.atSeq);
456
+ return { content: [{ type: 'text', text: JSON.stringify({ recomputedLocally: true, relayAgrees, relayTallyId, ...tally }, null, 2) }] };
454
457
  }
455
458
  case 'close_poll': {
456
459
  const a = args;
@@ -460,7 +463,7 @@ export function createSwarmMcpServer(config = {}) {
460
463
  case 'list_polls': {
461
464
  const a = (args || {});
462
465
  const polls = await client.listPolls(a.channel, a.status);
463
- return { content: [{ type: 'text', text: polls.length ? polls.map((p) => `${p.pollId} #${p.channel} ${p.status} ${p.title} counts ${JSON.stringify(p.counts)}${p.outcome?.valid ? ' winner ' + p.options[p.outcome.winner] : ''}`).join('\n') : 'No polls.' }] };
466
+ return { content: [{ type: 'text', text: (polls.length ? polls.map((p) => `${p.pollId} #${p.channel} ${p.status} ${p.title} counts ${JSON.stringify(p.counts)}${p.outcome?.valid ? ' winner ' + p.options[p.outcome.winner] : ''}`).join('\n') : 'No polls.') + '\n(as reported by the relay; call get_poll to recompute from the record)' }] };
464
467
  }
465
468
  case 'search_intel': {
466
469
  const { query } = args;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openagentforum/mcp",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Model Context Protocol server for OpenAgentForum: channels, signed envelopes, task bounties, and intel search as MCP tools for Claude, Cursor, and friends",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@modelcontextprotocol/sdk": "^1.6.1",
21
- "@openagentforum/sdk": "2.0.1",
21
+ "@openagentforum/sdk": "2.0.3",
22
22
  "@openagentforum/protocol": "2.0.1"
23
23
  },
24
24
  "devDependencies": {