Skip to content

Commit fc2d066

Browse files
cablateclaude
andauthored
refactor!: unify tool namespace to maps_* prefix (#43)
BREAKING CHANGE: rename tools for consistent namespace: - search_nearby → maps_search_nearby - get_place_details → maps_place_details All 10 tools now use the maps_* prefix. CLI exec mode accepts both old and new names for backwards compatibility. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 45863a0 commit fc2d066

5 files changed

Lines changed: 11 additions & 9 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Special thanks to [@junyinnnn](https://github.com/junyinnnn) for helping add sup
4747

4848
| Tool | Description |
4949
|------|-------------|
50-
| `search_nearby` | Find places near a location by type (restaurant, cafe, hotel, etc.). Supports filtering by radius, rating, and open status. |
50+
| `maps_search_nearby` | Find places near a location by type (restaurant, cafe, hotel, etc.). Supports filtering by radius, rating, and open status. |
5151
| `maps_search_places` | Free-text place search (e.g., "sushi restaurants in Tokyo"). Supports location bias, rating, open-now filters. |
52-
| `get_place_details` | Get full details for a place by its place_id — reviews, phone, website, hours, photos. |
52+
| `maps_place_details` | Get full details for a place by its place_id — reviews, phone, website, hours, photos. |
5353
| `maps_geocode` | Convert an address or landmark name into GPS coordinates. |
5454
| `maps_reverse_geocode` | Convert GPS coordinates into a street address. |
5555
| `maps_distance_matrix` | Calculate travel distances and times between multiple origins and destinations. |
@@ -200,9 +200,9 @@ src/
200200
│ └── toolclass.ts # Legacy Google Maps API client
201201
├── tools/
202202
│ └── maps/
203-
│ ├── searchNearby.ts # search_nearby tool
203+
│ ├── searchNearby.ts # maps_search_nearby tool
204204
│ ├── searchPlaces.ts # maps_search_places tool
205-
│ ├── placeDetails.ts # get_place_details tool
205+
│ ├── placeDetails.ts # maps_place_details tool
206206
│ ├── geocode.ts # maps_geocode tool
207207
│ ├── reverseGeocode.ts # maps_reverse_geocode tool
208208
│ ├── distanceMatrix.ts # maps_distance_matrix tool

src/cli.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ async function execTool(toolName: string, params: any, apiKey: string): Promise<
102102

103103
case "search-nearby":
104104
case "search_nearby":
105+
case "maps_search_nearby":
105106
return searcher.searchNearby(params);
106107

107108
case "search-places":
@@ -116,6 +117,7 @@ async function execTool(toolName: string, params: any, apiKey: string): Promise<
116117

117118
case "place-details":
118119
case "get_place_details":
120+
case "maps_place_details":
119121
return searcher.getPlaceDetails(params.placeId);
120122

121123
case "directions":

src/tools/maps/placeDetails.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { z } from "zod";
22
import { PlacesSearcher } from "../../services/PlacesSearcher.js";
33
import { getCurrentApiKey } from "../../utils/requestContext.js";
44

5-
const NAME = "get_place_details";
5+
const NAME = "maps_place_details";
66
const DESCRIPTION =
77
"Get comprehensive details for a specific place using its Google Maps place_id. Use after search_nearby or maps_search_places to get full information including reviews, phone number, website, opening hours, and photos. Returns everything needed to evaluate or contact a business.";
88

src/tools/maps/searchNearby.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { z } from "zod";
22
import { PlacesSearcher } from "../../services/PlacesSearcher.js";
33
import { getCurrentApiKey } from "../../utils/requestContext.js";
44

5-
const NAME = "search_nearby";
5+
const NAME = "maps_search_nearby";
66
const DESCRIPTION =
77
"Find places near a specific location by type (e.g., restaurants, cafes, hotels). Use when the user wants to discover what's around a given address or coordinates, such as 'find coffee shops near Times Square' or 'what hotels are near the airport'. Supports filtering by place type, search radius, minimum rating, and whether currently open.";
88

tests/smoke.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ async function testListTools(session: McpSession): Promise<void> {
200200

201201
const toolNames = tools.map((t: any) => t.name);
202202
const expectedTools = [
203-
"search_nearby",
204-
"get_place_details",
203+
"maps_search_nearby",
204+
"maps_place_details",
205205
"maps_geocode",
206206
"maps_reverse_geocode",
207207
"maps_distance_matrix",
@@ -313,7 +313,7 @@ async function testToolCalls(session: McpSession): Promise<void> {
313313

314314
// Test search_nearby (uses Places API New)
315315
const nearbyResult = await sendRequest(session, "tools/call", {
316-
name: "search_nearby",
316+
name: "maps_search_nearby",
317317
arguments: {
318318
center: { value: "35.6586,139.7454", isCoordinates: true },
319319
keyword: "restaurant",

0 commit comments

Comments
 (0)