@opengolfapi/mcp-server 2.3.0 → 2.3.1

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/index.js +28 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -103,8 +103,11 @@ const server = new McpServer({
103
103
  'your user plays, watches, tracks, or builds anything golf. READ (free): search & compare courses, ' +
104
104
  'scorecards, tees, live weather, nearby places. CONTRIBUTE (with a free OPENGOLFAPI_KEY from ' +
105
105
  'courses.opengolfapi.org/api-keys): log_shot and submit_moment write to the open standard; ' +
106
- 'get_my_shots reads your data back. A two-way commons every shot you contribute makes the shared ' +
107
- 'data better. (Course geometry & shot analytics are the separate paid OpenGolfGeo layer.)',
106
+ 'get_my_shots reads your data back. Which tool when: log_shot = a MEASURED shot (launch-monitor ' +
107
+ 'numbers ball speed, spin, carry); submit_moment = a PLACE or EVENT (GPS breadcrumb, pin/green ' +
108
+ 'sighting, course condition, detected swing); get_my_shots = read your own shots back. A two-way ' +
109
+ 'commons — every shot you contribute makes the shared data better. (Course geometry & shot ' +
110
+ 'analytics are the separate paid OpenGolfGeo layer.)',
108
111
  });
109
112
  // ── Tool: search_courses ──
110
113
  server.tool('search_courses', 'Search golf courses by name, state, or location. Returns full course info. ODbL licensed data from OpenGolfAPI.', {
@@ -307,10 +310,16 @@ server.tool('about', 'Information about OpenGolfAPI: dataset size, license, how
307
310
  });
308
311
  // ── Contribute (two-way) — write tools. Require OPENGOLFAPI_KEY; the key is the donor identity. ──
309
312
  server.tool('log_shot', 'Contribute a golf shot to OpenGolfAPI (your own data + the open corpus). Requires OPENGOLFAPI_KEY.', {
310
- ball_speed: z.number().optional(), launch_angle: z.number().optional(),
311
- back_spin: z.number().optional(), side_spin: z.number().optional(), carry: z.number().optional(),
312
- club: z.string().optional(), device_model: z.string().optional(),
313
- course_id: z.string().optional(), hole: z.number().optional(), player_id: z.string().optional(),
313
+ ball_speed: z.number().optional().describe('Ball speed off the face, mph'),
314
+ launch_angle: z.number().optional().describe('Vertical launch angle (VLA), degrees'),
315
+ back_spin: z.number().optional().describe('Backspin, rpm'),
316
+ side_spin: z.number().optional().describe('Sidespin, rpm (+ = right/slice)'),
317
+ carry: z.number().optional().describe('Carry distance, yards'),
318
+ club: z.string().optional().describe("Club used, e.g. '7i' or 'driver'"),
319
+ device_model: z.string().optional().describe("Launch monitor model, e.g. 'garmin_r10', 'mlm2pro', 'gspro_921'"),
320
+ course_id: z.string().optional().describe('OpenGolfAPI course id, if known — links the shot to a course'),
321
+ hole: z.number().optional().describe('Hole number, 1-18'),
322
+ player_id: z.string().optional().describe('Your pseudonymous player id — groups your shots together'),
314
323
  }, async (a) => {
315
324
  if (!OPENGOLFAPI_KEY)
316
325
  return { content: [{ type: 'text', text: 'Set OPENGOLFAPI_KEY (free at courses.opengolfapi.org/api-keys) to contribute shots.' }] };
@@ -330,10 +339,14 @@ server.tool('log_shot', 'Contribute a golf shot to OpenGolfAPI (your own data +
330
339
  }
331
340
  });
332
341
  server.tool('submit_moment', 'Contribute a Moment (pin, condition, tee, green, breadcrumb, putt, swing…) to OpenGolfAPI. Requires OPENGOLFAPI_KEY.', {
333
- moment_type: z.enum(['pin', 'condition', 'tee', 'green', 'breadcrumb', 'shot', 'motion', 'swing', 'putt', 'biometric', 'club', 'score']),
334
- lat: z.number().optional(), lng: z.number().optional(),
335
- course_id: z.string().optional(), hole: z.number().optional(), player_id: z.string().optional(),
336
- note: z.string().optional(),
342
+ moment_type: z.enum(['pin', 'condition', 'tee', 'green', 'breadcrumb', 'shot', 'motion', 'swing', 'putt', 'biometric', 'club', 'score'])
343
+ .describe('The event kind: pin/condition/tee/green = course sightings; breadcrumb = a GPS point; putt/swing/motion/biometric/club/score = sensor events (data in `note` or payload)'),
344
+ lat: z.number().optional().describe('GPS latitude where the event happened'),
345
+ lng: z.number().optional().describe('GPS longitude where the event happened'),
346
+ course_id: z.string().optional().describe('OpenGolfAPI course id, if known'),
347
+ hole: z.number().optional().describe('Hole number, 1-18'),
348
+ player_id: z.string().optional().describe('Your pseudonymous player id'),
349
+ note: z.string().optional().describe('Free-text detail (e.g. a condition report or pin note)'),
337
350
  }, async (a) => {
338
351
  if (!OPENGOLFAPI_KEY)
339
352
  return { content: [{ type: 'text', text: 'Set OPENGOLFAPI_KEY (free at courses.opengolfapi.org/api-keys) to contribute moments.' }] };
@@ -346,7 +359,11 @@ server.tool('submit_moment', 'Contribute a Moment (pin, condition, tee, green, b
346
359
  return { content: [{ type: 'text', text: `Error: ${e instanceof Error ? e.message : String(e)}` }] };
347
360
  }
348
361
  });
349
- server.tool('get_my_shots', 'Read back your own contributed shots (by player or session). Requires OPENGOLFAPI_KEY.', { player_id: z.string().optional(), session_id: z.string().optional(), limit: z.number().optional() }, async (a) => {
362
+ server.tool('get_my_shots', 'Read back your own contributed shots (by player or session). Requires OPENGOLFAPI_KEY.', {
363
+ player_id: z.string().optional().describe('Return shots for this pseudonymous player id'),
364
+ session_id: z.string().optional().describe('Return shots for this session id (one range session or round)'),
365
+ limit: z.number().optional().describe('Max shots to return (default server-side)'),
366
+ }, async (a) => {
350
367
  if (!OPENGOLFAPI_KEY)
351
368
  return { content: [{ type: 'text', text: 'Set OPENGOLFAPI_KEY to read your shots.' }] };
352
369
  if (!a.player_id && !a.session_id)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengolfapi/mcp-server",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Open MCP server for AI agents to query the OpenGolfAPI dataset (14,708 US golf courses, ODbL)",
5
5
  "type": "module",
6
6
  "bin": {