MCP Server
Tool reference
The three tools the GolfCourseAPI MCP server provides: their parameters, what they return, and the errors an assistant can see.
All tools are read-only and return structured output with an output schema. Each call makes exactly one GolfCourseAPI request with your API key, so each call uses one request from your daily quota. The usual flow is to find a course id with search_courses or find_courses_near, then call get_course for its tees and holes. Field meanings match the API docs.
search_courses
Search golf courses by course or club name. Returns up to 25 matches, most relevant first.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Course or club name, e.g. pebble beach or torrey pines south. |
fuzzy_match | boolean | No | Partial, typo-tolerant matching. Defaults to true; set false for exact full-text matching. |
Returns courses: a list of course summaries, each with id, club_name, course_name, location (address, city, state, country, latitude, longitude) and tees, the number of tee boxes per grouping (e.g. male, female). Summaries don't include ratings, yardages or holes. Call get_course for those.
get_course
Get one golf course with all of its tee boxes and holes.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The 8-character course id from search_courses or find_courses_near. |
Returns course: the course's id, names and location, plus tees keyed by grouping. Each tee box has:
tee_name,number_of_holes,par_total,total_yards,total_meterscourse_rating,slope_rating,bogey_rating- Front and back nine ratings:
front_course_rating,front_slope_rating,front_bogey_rating,back_course_rating,back_slope_rating,back_bogey_rating. 9-hole tees carry front nine ratings only. holes:par,yardage,metersandhandicapfor each hole
Fields we don't have for a course are left out, so treat ratings and meters as optional.
find_courses_near
Find golf courses near a latitude and longitude, nearest first. On the Free plan the call is rejected, and the rejected call doesn't count toward your quota.
| Parameter | Type | Required | Description |
|---|---|---|---|
latitude | number | Yes | Latitude of the search point, -90 to 90. |
longitude | number | Yes | Longitude of the search point, -180 to 180. |
radius | number | No | Search radius. Defaults to 10; at most 50 mi or 80 km. |
unit | string | No | mi (default) or km. |
limit | integer | No | Maximum number of courses. Defaults to 10; at most 25. |
Returns courses: the same summaries as search_courses, each with a distance from the point, and unit, the unit of those distances. Courses without coordinates are never returned.
Errors
When a call fails, the tool returns an error message the assistant can act on, and usually explains to you:
| Cause | Message the assistant sees |
|---|---|
| Invalid or rotated API key | The golfcourseapi API key is missing or invalid… |
find_courses_near on the Free plan | Proximity search requires a Pro or Enterprise golfcourseapi plan… |
Unknown get_course id | Course not found. Check the id… |
| Out-of-range or invalid parameter | Invalid input: <field>: <reason> |
| Daily quota used up | golfcourseapi rate limit hit: daily usage limit exceeded. Retry after … |
| Too many calls in a burst | golfcourseapi rate limit hit: rate limit exceeded |
Which errors count toward your quota?
Calls that reach the API count, even if they fail: unknown course ids, searches with no results and out-of-range parameters all use a request. An empty query or id is caught by the MCP server before any API call, so it doesn't count. Neither do bad keys, plan-gated calls or calls over your limit. See Quota and plan limits.
Something not working the way this page describes? .