mirror of
https://github.com/Sea-Haven-Industries/sh-mcp.git
synced 2026-10-06 20:32:03 +00:00
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
|
|
/**
|
||
|
|
* @sh-mcp/google-maps — public entry point.
|
||
|
|
*
|
||
|
|
* Exports the tools array and the client interface so callers can inject
|
||
|
|
* a concrete GooglePlacesClient (or a mock in tests).
|
||
|
|
*
|
||
|
|
* Usage in a server:
|
||
|
|
*
|
||
|
|
* import { tools } from '@sh-mcp/google-maps';
|
||
|
|
* import { GooglePlacesClient } from '@sh-mcp/google-maps/client';
|
||
|
|
*
|
||
|
|
* const mapsClient = new GooglePlacesClient(process.env.GOOGLE_MAPS_API_KEY!);
|
||
|
|
* // tools is pre-wired with the concrete client
|
||
|
|
*
|
||
|
|
* The tools array is also exported for dynamic wiring:
|
||
|
|
*
|
||
|
|
* import { makeTools } from '@sh-mcp/google-maps';
|
||
|
|
* const tools = makeTools(new GooglePlacesClient(apiKey));
|
||
|
|
*/
|
||
|
|
|
||
|
|
export { GooglePlacesClient } from './client.js';
|
||
|
|
export type { GoogleMapsClient, PlaceResult, SearchTextParams } from './client.js';
|
||
|
|
export type { SearchNearbyVendorsInput, SearchNearbyVendorsOutput, VendorListing } from './tools.js';
|
||
|
|
export { makeSearchNearbyVendors } from './tools.js';
|
||
|
|
|
||
|
|
import type { ToolDef } from '@sh-mcp/shared';
|
||
|
|
import type { GoogleMapsClient } from './client.js';
|
||
|
|
import { makeSearchNearbyVendors } from './tools.js';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Build the full tools array wired to an injected client.
|
||
|
|
* Servers call this at startup with their concrete GooglePlacesClient.
|
||
|
|
*/
|
||
|
|
export function makeTools(
|
||
|
|
client: GoogleMapsClient,
|
||
|
|
): ToolDef<unknown, unknown>[] {
|
||
|
|
return [
|
||
|
|
makeSearchNearbyVendors(client) as ToolDef<unknown, unknown>,
|
||
|
|
];
|
||
|
|
}
|