@opengolfapi/mcp-server 2.3.0 → 2.3.2

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 +9 -0
  2. package/dist/index.js +27 -11
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -55,11 +55,20 @@ Donor tiers raise the daily limit further (10k / 50k / 250k / 1M).
55
55
 
56
56
  ## Tools
57
57
 
58
+ **Read (free, no key):**
58
59
  - `search_courses(query, state?, lat?, lng?, radius_mi?)` — find courses by name, state, or location
59
60
  - `get_course(id)` — full course record with scorecard (par + handicap index per hole)
60
61
  - `get_tees(id)` — all tee sets with ratings, slopes, and yardages
61
62
  - `get_climate(id)` — monthly climate normals for the course location
62
63
  - `get_nearby(id)` — nearby POIs (hotels, restaurants, airports)
64
+ - `about()` — what OpenGolfAPI is and how to contribute
65
+
66
+ **Contribute (free key — set `OPENGOLFAPI_KEY`):**
67
+ - `log_shot(...)` — send a launch-monitor shot to the open OpenShot standard
68
+ - `submit_moment(...)` — send an event (breadcrumb, pin, condition, tee, green, swing…)
69
+ - `get_my_shots(player?, session?)` — read your own contributed shots back
70
+
71
+ **REST API references:** [`/openapi.json`](https://api.opengolfapi.org/openapi.json) (full OpenAPI 3.1 spec) · [`/llms.txt`](https://api.opengolfapi.org/llms.txt) (AI usage guide) · [`/api/v1/openshot/fields`](https://api.opengolfapi.org/api/v1/openshot/fields) (OpenShot field catalog).
63
72
 
64
73
  ## Telemetry
65
74
 
package/dist/index.js CHANGED
@@ -103,8 +103,10 @@ 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 for everyone.',
108
110
  });
109
111
  // ── Tool: search_courses ──
110
112
  server.tool('search_courses', 'Search golf courses by name, state, or location. Returns full course info. ODbL licensed data from OpenGolfAPI.', {
@@ -307,10 +309,16 @@ server.tool('about', 'Information about OpenGolfAPI: dataset size, license, how
307
309
  });
308
310
  // ── Contribute (two-way) — write tools. Require OPENGOLFAPI_KEY; the key is the donor identity. ──
309
311
  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(),
312
+ ball_speed: z.number().optional().describe('Ball speed off the face, mph'),
313
+ launch_angle: z.number().optional().describe('Vertical launch angle (VLA), degrees'),
314
+ back_spin: z.number().optional().describe('Backspin, rpm'),
315
+ side_spin: z.number().optional().describe('Sidespin, rpm (+ = right/slice)'),
316
+ carry: z.number().optional().describe('Carry distance, yards'),
317
+ club: z.string().optional().describe("Club used, e.g. '7i' or 'driver'"),
318
+ device_model: z.string().optional().describe("Launch monitor model, e.g. 'garmin_r10', 'mlm2pro', 'gspro_921'"),
319
+ course_id: z.string().optional().describe('OpenGolfAPI course id, if known — links the shot to a course'),
320
+ hole: z.number().optional().describe('Hole number, 1-18'),
321
+ player_id: z.string().optional().describe('Your pseudonymous player id — groups your shots together'),
314
322
  }, async (a) => {
315
323
  if (!OPENGOLFAPI_KEY)
316
324
  return { content: [{ type: 'text', text: 'Set OPENGOLFAPI_KEY (free at courses.opengolfapi.org/api-keys) to contribute shots.' }] };
@@ -330,10 +338,14 @@ server.tool('log_shot', 'Contribute a golf shot to OpenGolfAPI (your own data +
330
338
  }
331
339
  });
332
340
  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(),
341
+ moment_type: z.enum(['pin', 'condition', 'tee', 'green', 'breadcrumb', 'shot', 'motion', 'swing', 'putt', 'biometric', 'club', 'score'])
342
+ .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)'),
343
+ lat: z.number().optional().describe('GPS latitude where the event happened'),
344
+ lng: z.number().optional().describe('GPS longitude where the event happened'),
345
+ course_id: z.string().optional().describe('OpenGolfAPI course id, if known'),
346
+ hole: z.number().optional().describe('Hole number, 1-18'),
347
+ player_id: z.string().optional().describe('Your pseudonymous player id'),
348
+ note: z.string().optional().describe('Free-text detail (e.g. a condition report or pin note)'),
337
349
  }, async (a) => {
338
350
  if (!OPENGOLFAPI_KEY)
339
351
  return { content: [{ type: 'text', text: 'Set OPENGOLFAPI_KEY (free at courses.opengolfapi.org/api-keys) to contribute moments.' }] };
@@ -346,7 +358,11 @@ server.tool('submit_moment', 'Contribute a Moment (pin, condition, tee, green, b
346
358
  return { content: [{ type: 'text', text: `Error: ${e instanceof Error ? e.message : String(e)}` }] };
347
359
  }
348
360
  });
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) => {
361
+ server.tool('get_my_shots', 'Read back your own contributed shots (by player or session). Requires OPENGOLFAPI_KEY.', {
362
+ player_id: z.string().optional().describe('Return shots for this pseudonymous player id'),
363
+ session_id: z.string().optional().describe('Return shots for this session id (one range session or round)'),
364
+ limit: z.number().optional().describe('Max shots to return (default server-side)'),
365
+ }, async (a) => {
350
366
  if (!OPENGOLFAPI_KEY)
351
367
  return { content: [{ type: 'text', text: 'Set OPENGOLFAPI_KEY to read your shots.' }] };
352
368
  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.2",
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": {