Skip to content

Commit 034b188

Browse files
cablateclaude
andauthored
chore: update descriptions, server.json version, add CLAUDE.md (#36)
- Simplify package.json description (remove marketing language) - Update server.json version to 0.0.26 (matches npm) - Shorten server.json description to meet registry 100-char limit - Add CLAUDE.md with git workflow rules - Update tools-api.md with scenario recipes and decision guide Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7dd3b03 commit 034b188

4 files changed

Lines changed: 195 additions & 16 deletions

File tree

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# CLAUDE.md
2+
3+
## Git Workflow
4+
5+
- **永遠不要直接推 main**。所有變更都要先開 feature branch、推上去、建 PR,等審核通過後才合併。
6+
- Commit 完成後走 `git checkout -b feat/xxx``git push -u origin feat/xxx``gh pr create` 流程。

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@cablate/mcp-google-map",
33
"version": "0.0.27",
44
"mcpName": "io.github.cablate/google-map",
5-
"description": "Google Maps tools for AI agents — 8 tools (geocode, search, directions, elevation) via MCP server or standalone Agent Skill CLI",
5+
"description": "Google Maps tools for AI agents — geocode, search, directions, elevation via MCP server or standalone CLI",
66
"type": "module",
77
"main": "dist/index.js",
88
"bin": {

server.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
33
"name": "io.github.cablate/google-map",
44
"title": "Google Maps MCP Server",
5-
"description": "Google Maps tools for AI agents — 8 tools (geocode, search, directions, elevation) via MCP server or standalone Agent Skill CLI. The only maps MCP with Agent Skill definitions, exec CLI mode, and StreamableHTTP multi-session support.",
5+
"description": "Google Maps tools for AI agents — geocode, search, directions, elevation. stdio + HTTP.",
66
"repository": {
77
"url": "https://github.com/cablate/mcp-google-map",
88
"source": "github"
99
},
10-
"version": "0.0.24",
10+
"version": "0.0.26",
1111
"packages": [
1212
{
1313
"registryType": "npm",
1414
"identifier": "@cablate/mcp-google-map",
15-
"version": "0.0.24",
15+
"version": "0.0.26",
1616
"transport": {
1717
"type": "stdio"
1818
},

skills/google-maps/references/tools-api.md

Lines changed: 185 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,194 @@ Response:
160160

161161
---
162162

163-
## Common Chaining Patterns
163+
## Chaining Patterns
164164

165-
**Search → Details**
166-
```bash
167-
exec search-places '{"query":"Michelin restaurants in Taipei"}'
168-
exec place-details '{"placeId":"ChIJ..."}' # use place_id from results
165+
### Basic Patterns
166+
167+
**Search → Details** — Find places, then get full info on the best ones.
168+
```
169+
search-places {"query":"Michelin restaurants in Taipei"}
170+
place-details {"placeId":"ChIJ..."} ← use place_id from results
169171
```
170172

171-
**Geocode → Nearby Search**
172-
```bash
173-
exec geocode '{"address":"Taipei 101"}'
174-
exec search-nearby '{"center":{"value":"25.033,121.564","isCoordinates":true},"keyword":"cafe","radius":500}'
173+
**Geocode → Nearby** — Turn a landmark into coordinates, then explore the area.
174+
```
175+
geocode {"address":"Taipei 101"}
176+
search-nearby {"center":{"value":"25.033,121.564","isCoordinates":true},"keyword":"cafe","radius":500}
175177
```
176178

177-
**Multi-point Comparison**
178-
```bash
179-
exec distance-matrix '{"origins":["Taipei Main Station","Banqiao Station"],"destinations":["Taoyuan Airport","Songshan Airport"],"mode":"driving"}'
179+
**Multi-point Comparison** — Compare distances across multiple origins and destinations in one call.
180+
```
181+
distance-matrix {"origins":["Taipei Main Station","Banqiao Station"],"destinations":["Taoyuan Airport","Songshan Airport"],"mode":"driving"}
182+
```
183+
184+
---
185+
186+
## Scenario Recipes
187+
188+
Use these recipes when the user's question maps to a multi-step workflow. Think of each recipe as a **decision tree**, not a script — adapt based on what the user actually needs.
189+
190+
### Recipe 1: Trip Planning ("Plan a day in Tokyo")
191+
192+
This is the most common complex scenario. The goal is a time-ordered itinerary with routes between stops.
193+
194+
**Steps:**
195+
1. `geocode` — Resolve all mentioned landmarks to coordinates
196+
2. `search-nearby` — Find restaurants/attractions near each landmark (use coordinates from step 1)
197+
3. `place-details` — Get ratings, hours, reviews for top candidates (use place_id from step 2)
198+
4. `distance-matrix` — Compare travel times between all candidate stops to find the optimal order
199+
5. `directions` — Generate turn-by-turn routes between stops in the final order
200+
201+
**Key decisions:**
202+
- If the user says "near X", use `search-nearby`. If they say "best Y in Z", use `search-places`.
203+
- Always check `opening_hours` from `place-details` before including in itinerary.
204+
- Use `distance-matrix` to order stops efficiently, THEN use `directions` for the final route.
205+
206+
**Example output shape:**
207+
```
208+
Morning: Tokyo Tower (9:00) → 12 min walk → Zojoji Temple (9:30)
209+
Lunch: Sushi Dai (11:30) ★4.6 — 2.1 km, 8 min by transit
210+
Afternoon: TeamLab (14:00) → Odaiba area
180211
```
212+
213+
---
214+
215+
### Recipe 2: "What's nearby?" / Local Discovery
216+
217+
User asks about places around a location. May or may not specify what type.
218+
219+
**Steps:**
220+
1. `geocode` — Resolve the location (skip if user gave coordinates)
221+
2. `search-nearby` — Search with keyword + radius. Use `openNow: true` if the user implies "right now"
222+
3. `place-details` — Get details for the top 3-5 results (ratings, reviews, hours)
223+
224+
**Key decisions:**
225+
- If no keyword specified, search multiple types: restaurant, cafe, attraction
226+
- Use `minRating: 4.0` by default unless the user wants comprehensive results
227+
- Sort results by rating × review count, not just rating alone
228+
229+
---
230+
231+
### Recipe 3: Route Comparison ("Best way to get from A to B")
232+
233+
User wants to compare travel options between two points.
234+
235+
**Steps:**
236+
1. `directions` with `mode: "driving"` — Get driving route
237+
2. `directions` with `mode: "transit"` — Get transit route
238+
3. `directions` with `mode: "walking"` — Get walking route (if distance < 5 km)
239+
240+
**Present as comparison table:**
241+
```
242+
| Mode | Duration | Distance | Notes |
243+
|---------|----------|----------|------------------|
244+
| Driving | 25 min | 12.3 km | Via Highway 1 |
245+
| Transit | 35 min | — | Metro Line 2 |
246+
| Walking | 2h 10min | 10.1 km | Not recommended |
247+
```
248+
249+
---
250+
251+
### Recipe 4: Neighborhood Analysis ("Is this a good area?")
252+
253+
User wants to evaluate a location for living, working, or investing.
254+
255+
**Steps:**
256+
1. `geocode` — Resolve the address
257+
2. `search-nearby` — Run multiple searches from the same center:
258+
- `keyword: "school"` radius 2000
259+
- `keyword: "hospital"` radius 3000
260+
- `keyword: "supermarket"` radius 1000
261+
- `keyword: "restaurant"` radius 500
262+
- `keyword: "park"` radius 1000
263+
3. `distance-matrix` — Calculate commute time to important locations (office, airport, city center)
264+
4. `elevation` — Check if the area is in a low-elevation flood zone
265+
266+
**Present as scorecard:**
267+
```
268+
📍 742 Evergreen Terrace
269+
Schools within 2km: 4 (avg ★4.2)
270+
Hospitals within 3km: 2
271+
Supermarkets within 1km: 3
272+
Commute to downtown: 22 min driving, 35 min transit
273+
Elevation: 45m (not a flood risk)
274+
```
275+
276+
---
277+
278+
### Recipe 5: Multi-Stop Route ("Visit these 5 places efficiently")
279+
280+
User has a list of places and wants the optimal visit order.
281+
282+
**Steps:**
283+
1. `geocode` — Resolve all addresses to coordinates
284+
2. `distance-matrix` — Calculate NxN matrix (all origins × all destinations)
285+
3. Use the matrix to determine the nearest-neighbor route order
286+
4. `directions` — Generate route for the final order (chain waypoints)
287+
288+
**Key decisions:**
289+
- For ≤ 5 stops, nearest-neighbor heuristic is good enough
290+
- For the `directions` call, set origin = first stop, destination = last stop, and mention intermediate stops in conversation
291+
- If the user says "return to start", plan a round trip
292+
293+
---
294+
295+
### Recipe 6: Place Comparison ("Which restaurant should I pick?")
296+
297+
User is choosing between specific places.
298+
299+
**Steps:**
300+
1. `search-places` — Find each place (or use place_id if already known)
301+
2. `place-details` — Get full details for each candidate
302+
3. `distance-matrix` — Calculate distance from user's location to each candidate
303+
304+
**Present as comparison:**
305+
```
306+
| Restaurant | Rating | Reviews | Distance | Price | Open Now |
307+
|-----------|--------|---------|----------|-------|----------|
308+
| Sushi Dai | ★4.6 | 2,340 | 1.2 km | $$ | Yes |
309+
| Tsukiji | ★4.3 | 890 | 0.8 km | $ | Yes |
310+
| Omakase | ★4.8 | 156 | 3.1 km | $$$$ | No |
311+
```
312+
313+
---
314+
315+
### Recipe 7: "Along the Route" Search
316+
317+
User wants to find things along a route (gas stations, rest stops, food).
318+
319+
**Steps:**
320+
1. `directions` — Get the route first, extract key waypoints from the steps
321+
2. `search-nearby` — Search near 2-3 midpoints along the route
322+
3. `place-details` — Get details for top results at each midpoint
323+
324+
**Key decisions:**
325+
- Extract waypoints at roughly equal intervals along the route
326+
- Use the `start_location` of route steps at ~1/3 and ~2/3 of the total distance
327+
- Set `radius` based on road type: 1000m for highways, 500m for city streets
328+
329+
---
330+
331+
## Decision Guide: Which Recipe to Use
332+
333+
| User says... | Recipe | First tool |
334+
|-------------|--------|------------|
335+
| "Plan a trip / itinerary / day in X" | Trip Planning | `geocode` |
336+
| "What's near X / around X" | Local Discovery | `geocode``search-nearby` |
337+
| "How do I get to X" / "route from A to B" | Route Comparison | `directions` |
338+
| "Is X a good neighborhood" / "analyze this area" | Neighborhood Analysis | `geocode` |
339+
| "Visit A, B, C, D efficiently" | Multi-Stop Route | `geocode``distance-matrix` |
340+
| "Which X should I pick" / "compare these" | Place Comparison | `search-places` |
341+
| "Find gas stations on the way to X" | Along the Route | `directions``search-nearby` |
342+
343+
---
344+
345+
## Future Composite Tools (Planned)
346+
347+
These high-frequency scenarios are candidates for single-call composite tools in a future version:
348+
349+
| Composite Tool | What it would do | Replaces |
350+
|---------------|-----------------|----------|
351+
| `maps_explore_area` | geocode + multi-type search-nearby + place-details for top results | Recipe 2 (3-call → 1-call) |
352+
| `maps_plan_route` | geocode all stops + distance-matrix + directions in optimal order | Recipe 5 (4-call → 1-call) |
353+
| `maps_compare_places` | search + details + distance for N candidates | Recipe 6 (3-call → 1-call) |

0 commit comments

Comments
 (0)