Skip to content

Commit 4f92df6

Browse files
Revert "[tools] Enhance tool descriptions for better semantic matching and RA…" (#82)
This reverts commit ff99f6d.
1 parent 2f63f77 commit 4f92df6

11 files changed

Lines changed: 14 additions & 1093 deletions

File tree

src/tools/category-search-tool/CategorySearchTool.ts

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,8 @@ export class CategorySearchTool extends MapboxApiBasedTool<
1919
typeof CategorySearchResponseSchema
2020
> {
2121
name = 'category_search_tool';
22-
description = `Search for points of interest by category or type (restaurants, gas stations, hotels, ATMs, parking, coffee shops, pharmacies, museums, hospitals, etc.). Returns a list of nearby places matching the category with coordinates, names, addresses, and details.
23-
24-
Use this when:
25-
- User asks for a type or category of place (plural/generic): "Where are the restaurants nearby?", "Show me all coffee shops"
26-
- Browsing options: "What hotels are available downtown?", "Find gas stations along this route"
27-
- Discovery queries: "What's around here?", "Show me all ATMs in this neighborhood"
28-
- Generic searches with keywords like 'any', 'all', 'nearby', 'around', 'in this area'
29-
30-
Common use cases:
31-
- Find all POIs by type: "Show me all pharmacies within 5 miles"
32-
- Browse options: "What restaurants are near Times Square?"
33-
- Amenity search: "Find EV charging stations nearby"
34-
- Service discovery: "Where are the nearest hospitals?"
35-
- Shopping: "Show me all grocery stores in downtown Seattle"
36-
37-
Difference from search_and_geocode_tool:
38-
- Use category_search_tool for types/categories (e.g., "all restaurants", "coffee shops")
39-
- Use search_and_geocode_tool for specific names/brands (e.g., "Starbucks on 5th Ave", "Empire State Building")
40-
41-
Supports both JSON and text output formats.`;
22+
description =
23+
"Return all places that match a category (industry, amenity, or NAICS‑style code). Use when the user asks for a type of place, plural or generic terms like 'museums', 'coffee shops', 'electric‑vehicle chargers', or when the query includes is‑a phrases such as 'any', 'all', 'nearby'. Do not use when a unique name or brand is provided. Supports both JSON and text output formats.";
4224
annotations = {
4325
title: 'Category Search Tool',
4426
readOnlyHint: true,

src/tools/directions-tool/DirectionsTool.ts

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,8 @@ export class DirectionsTool extends MapboxApiBasedTool<
2121
typeof DirectionsResponseSchema
2222
> {
2323
name = 'directions_tool';
24-
description = `Calculate optimal routes and turn-by-turn directions (navigation) between two or more locations. Returns detailed driving, walking, or cycling instructions with route geometry (path), distance, duration, and estimated travel time (ETA).
25-
26-
Supports multiple routing modes:
27-
- Driving routes with real-time traffic (car navigation, auto routing)
28-
- Walking directions (pedestrian routes, on foot)
29-
- Cycling routes (bike paths, bicycle-friendly roads)
30-
- Multiple waypoints (road trip planning, multi-stop routes)
31-
32-
Common use cases:
33-
- Get driving directions from point A to B: "How do I drive from LAX to Hollywood?"
34-
- Calculate travel time and distance: "How long to walk from Central Park to Times Square?"
35-
- Plan multi-stop routes: "Route from hotel to museum to restaurant to hotel"
36-
- Compare route options: "Show me the fastest route avoiding tolls"
37-
- Navigation with traffic: "Driving directions with current traffic conditions"
38-
39-
Returns:
40-
- Turn-by-turn instructions
41-
- Route geometry (GeoJSON path for mapping)
42-
- Total distance and duration
43-
- Step-by-step maneuvers
44-
45-
Related tools:
46-
- Use matrix_tool for travel times between many locations
47-
- Use isochrone_tool to see areas reachable within a time limit
48-
- Use search_and_geocode_tool to convert addresses to coordinates first`;
24+
description =
25+
'Fetches directions from Mapbox API based on provided coordinates and direction method.';
4926
annotations = {
5027
title: 'Directions Tool',
5128
readOnlyHint: true,

src/tools/isochrone-tool/IsochroneTool.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,11 @@ export class IsochroneTool extends MapboxApiBasedTool<
1616
typeof IsochroneResponseSchema
1717
> {
1818
name = 'isochrone_tool';
19-
description = `Computes areas that are reachable within a specified amount of time or distance from a location (reachability analysis, coverage area, service area). Returns the reachable regions as contours of Polygons or LineStrings in GeoJSON format that you can display on a map.
20-
19+
description = `Computes areas that are reachable within a specified amount of time from a location, and returns the reachable regions as contours of Polygons or LineStrings in GeoJSON format that you can display on a map.
2120
Common use cases:
2221
- Show a user how far they can travel in X minutes from their current location
2322
- Determine whether a destination is within a certain travel time threshold
24-
- Compare travel ranges for different modes of transportation (driving, walking, cycling)
25-
- Visualize service coverage areas for businesses or facilities
26-
- Analyze accessibility and reachability for logistics planning
27-
- Find all areas within 30-minute drive time for delivery zones
28-
29-
Returns:
30-
- GeoJSON contours showing reachable areas
31-
- Multiple time/distance bands (e.g., 10, 20, 30 minutes)
32-
- Visualizable polygons for mapping coverage`;
23+
- Compare travel ranges for different modes of transportation'`;
3324
annotations = {
3425
title: 'Isochrone Tool',
3526
readOnlyHint: true,

src/tools/matrix-tool/MatrixTool.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,8 @@ export class MatrixTool extends MapboxApiBasedTool<
1919
typeof MatrixResponseSchema
2020
> {
2121
name = 'matrix_tool';
22-
description = `Calculate travel times and distances between multiple origin and destination points (one-to-many, many-to-one, or many-to-many routing). Returns a distance/duration matrix showing travel time (ETA) and distance from each origin to each destination.
23-
24-
Common use cases:
25-
- Logistics and route optimization: "Calculate travel times from warehouse to 10 delivery addresses"
26-
- Find nearest location: "Which store location is closest to this customer?"
27-
- Delivery time estimates: "How long to deliver from restaurant to multiple addresses?"
28-
- Service area analysis: "Calculate distances from office to all branch locations"
29-
- Multi-point comparison: "Compare travel times between 5 hotels and 3 attractions"
30-
31-
Supports:
32-
- One-to-many: Single origin to multiple destinations
33-
- Many-to-one: Multiple origins to single destination
34-
- Many-to-many: Multiple origins to multiple destinations
35-
- Different travel modes: driving (with traffic), walking, cycling
36-
37-
Returns:
38-
- Matrix of travel times (durations) between all point pairs
39-
- Matrix of distances between all point pairs
40-
- Efficient bulk calculations for route optimization
41-
42-
Related tools:
43-
- Use directions_tool for turn-by-turn directions for a single route
44-
- Use isochrone_tool to visualize all areas reachable within a time limit`;
22+
description =
23+
'Calculates travel times and distances between multiple points using Mapbox Matrix API.';
4524
annotations = {
4625
title: 'Matrix Tool',
4726
readOnlyHint: true,

src/tools/reverse-geocode-tool/ReverseGeocodeTool.ts

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,8 @@ export class ReverseGeocodeTool extends MapboxApiBasedTool<
1919
typeof GeocodingResponseSchema
2020
> {
2121
name = 'reverse_geocode_tool';
22-
description = `Convert geographic coordinates (longitude, latitude) into human-readable addresses or place names (reverse geocoding). Returns addresses, cities, towns, neighborhoods, postal codes (zip codes), districts, regions, and countries for a specific coordinate pair.
23-
24-
Common use cases:
25-
- "What address is at these coordinates?" - Get street address from GPS location
26-
- "Where am I?" - Convert device location to readable address
27-
- "What city is this?" - Identify city/town from coordinates
28-
- "Get postal code for location" - Find zip code or postal code
29-
- "Reverse geocode map click" - Display address when user clicks on map
30-
31-
Returns information about:
32-
- Street addresses (house number and street name)
33-
- Neighborhoods and districts
34-
- Cities, towns, and villages
35-
- Postal codes and zip codes
36-
- States, provinces, and regions
37-
- Countries
38-
39-
Note: Use limit=1 for best results (most relevant match). This tool cannot reverse geocode businesses, landmarks, historic sites, and other points of interest - it only returns administrative locations and addresses.
40-
41-
Related tools:
42-
- Use search_and_geocode_tool for the opposite: convert addresses to coordinates (forward geocoding)
43-
- Use search_and_geocode_tool to find businesses or POIs by name
44-
45-
Supports both JSON and text output formats.`;
22+
description =
23+
'Find addresses, cities, towns, neighborhoods, postcodes, districts, regions, and countries around a specified geographic coordinate pair. Converts geographic coordinates (longitude, latitude) into human-readable addresses or place names. Use limit=1 for best results. This tool cannot reverse geocode businesses, landmarks, historic sites, and other points of interest that are not of the types mentioned. Supports both JSON and text output formats.';
4624
annotations = {
4725
title: 'Reverse Geocode Tool',
4826
readOnlyHint: true,

src/tools/search-and-geocode-tool/SearchAndGeocodeTool.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,8 @@ export class SearchAndGeocodeTool extends MapboxApiBasedTool<
2222
typeof SearchBoxResponseSchema
2323
> {
2424
name = 'search_and_geocode_tool';
25-
description = `Search for specific points of interest (POIs), businesses, brands, landmarks, and convert addresses or place names to coordinates (geocoding). Returns detailed location information including coordinates (latitude/longitude), addresses, and place metadata.
26-
27-
Use this when:
28-
- User specifies a particular place name, brand, or business (e.g., "Starbucks on 5th Avenue", "Empire State Building")
29-
- Converting addresses to coordinates for mapping or routing
30-
- Looking up specific landmarks, buildings, or locations by name
31-
- Need precise location details for a named place
32-
33-
Common use cases:
34-
- Geocode an address: "123 Main Street, Seattle, WA" → coordinates
35-
- Find a specific business: "Find the nearest Tesla showroom"
36-
- Locate landmarks: "Where is the Statue of Liberty?"
37-
- Get coordinates for routing: "Get directions from Central Park to Times Square"
38-
39-
Related tools:
40-
- Use category_search_tool for browsing all places by type (e.g., "all restaurants nearby", "show me gas stations")
41-
- Use reverse_geocode_tool to convert coordinates back to addresses
42-
43-
Note: Do not use for generic place types like 'museums', 'coffee shops', 'tacos' - category_search_tool is better for that. Setting a proximity point is strongly encouraged for more local results.`;
25+
description =
26+
"Search for POIs, brands, chains, geocode cities, towns, addresses. Do not use for generic place types such as 'museums', 'coffee shops', 'tacos', etc, because category_search_tool is better for that. Setting a proximity point is strongly encouraged for more local results.";
4427
annotations = {
4528
title: 'Search and Geocode Tool',
4629
readOnlyHint: true,

src/tools/static-map-image-tool/StaticMapImageTool.ts

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,8 @@ export class StaticMapImageTool extends MapboxApiBasedTool<
1414
typeof StaticMapImageInputSchema
1515
> {
1616
name = 'static_map_image_tool';
17-
description = `Generate a static map image URL from Mapbox Static Images API. Creates a snapshot/thumbnail of a map location with optional markers, paths, and overlays. Returns a direct URL to the image (PNG or JPEG format), not an embedded image.
18-
19-
Common use cases:
20-
- Create shareable map snapshots for reports or documentation
21-
- Generate thumbnail previews of locations for listings or search results
22-
- Embed map images in emails, PDFs, or presentations
23-
- Show route overview as static image
24-
- Create before/after comparison maps
25-
- Display location context in non-interactive formats
26-
27-
Supports:
28-
- Custom center coordinates and zoom level (0-22)
29-
- Image dimensions up to 1280x1280 pixels
30-
- Multiple map styles (streets, satellite, outdoors, dark, light, etc.)
31-
- Markers with custom colors and labels
32-
- Paths and polylines (routes, boundaries)
33-
- GeoJSON overlays for complex shapes
34-
35-
Output format:
36-
- Returns direct URL string to image file
37-
- PNG format for vector styles
38-
- JPEG format for raster/satellite styles
39-
- URL can be embedded in HTML, shared, or downloaded
40-
41-
Related tools:
42-
- Use directions_tool to get route geometry to display on static map
43-
- Use search_and_geocode_tool to get coordinates for map center`;
17+
description =
18+
'Generates a static map image from Mapbox Static Images API. Supports center coordinates, zoom level (0-22), image size (up to 1280x1280), various Mapbox styles, and overlays (markers, paths, GeoJSON). Returns PNG for vector styles, JPEG for raster-only styles.';
4419
annotations = {
4520
title: 'Static Map Image Tool',
4621
readOnlyHint: true,

test/tools/README.md

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)