ergzone-mcp 1.2.0 → 1.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.
package/README.md CHANGED
@@ -14,7 +14,7 @@ You need a Concept2 Logbook account (the one you use on log.concept2.com).
14
14
 
15
15
  ### Claude Desktop — one-click (no terminal)
16
16
 
17
- 1. Download `ergzone-mcp.mcpb` from the [latest release](https://github.com/malveo/ergzone-mcp/releases/latest).
17
+ 1. [Download `ergzone-mcp.mcpb`](https://github.com/malveo/ergzone-mcp/releases/latest/download/ergzone-mcp.mcpb) (direct link, always the latest).
18
18
  2. Double-click it (or drag it into Claude Desktop → Settings → Extensions).
19
19
  3. Type your Logbook email and password in the form, and make sure the extension is **enabled**. Done.
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ergzone-mcp",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Unofficial MCP server for ErgZone (Concept2 rowing). Zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/tools.mjs CHANGED
@@ -45,6 +45,45 @@ export const TOOLS = [
45
45
  },
46
46
  },
47
47
 
48
+ {
49
+ name: 'update_profile',
50
+ description:
51
+ 'Update your profile settings: max HR, resting HR, weight, weight unit. Only the fields you pass are changed (others are left untouched). Sets these on the account so analyze_result and the HR zones use them automatically.',
52
+ write: true,
53
+ inputSchema: {
54
+ type: 'object',
55
+ properties: {
56
+ maxHeartRate: { type: 'number', description: 'Max heart rate (bpm), integer' },
57
+ restingHeartRate: { type: 'number', description: 'Resting heart rate (bpm), integer' },
58
+ weight: { type: 'number', description: 'Body weight, integer in the chosen weightUnit' },
59
+ weightUnit: { type: 'string', enum: ['kg', 'lbs'], description: 'Weight unit: kg or lbs' },
60
+ },
61
+ },
62
+ async handler(args) {
63
+ const settings = {};
64
+ // Send only provided fields so unspecified ones are not overwritten.
65
+ // maxHeartRate / restingHeartRate accept null to clear the value.
66
+ if ('maxHeartRate' in args) settings.maxHeartRate = args.maxHeartRate == null ? null : Math.round(args.maxHeartRate);
67
+ if ('restingHeartRate' in args) settings.restingHeartRate = args.restingHeartRate == null ? null : Math.round(args.restingHeartRate);
68
+ if ('weight' in args) settings.weight = args.weight == null ? null : Math.round(args.weight);
69
+ if ('weightUnit' in args) settings.weightUnit = args.weightUnit;
70
+
71
+ if (Object.keys(settings).length === 0) {
72
+ throw new Error('Nothing to update: pass at least one of maxHeartRate, restingHeartRate, weight, weightUnit.');
73
+ }
74
+ if (settings.weightUnit != null && !['kg', 'lbs'].includes(settings.weightUnit)) {
75
+ throw new Error('weightUnit must be "kg" or "lbs".');
76
+ }
77
+
78
+ const d = await gql(
79
+ `mutation($s:SettingsInput!){ settingsUpdate(settings:$s){ id name email maxHeartRate restingHeartRate weight weightUnit } }`,
80
+ { s: settings },
81
+ );
82
+ if (!d.settingsUpdate) throw new Error('Profile update failed.');
83
+ return { updated: d.settingsUpdate };
84
+ },
85
+ },
86
+
48
87
  {
49
88
  name: 'list_workouts',
50
89
  description: 'List the workouts in a track (defaults to your "My Workouts" track, auto-detected). Optional filters: search, limit.',