multi_platform_reviews
Retrieve combined ratings and review counts from Google and Trustpilot for any business, with per-platform details.
Instructions
Get review data across multiple platforms (Google, Trustpilot). Returns per-platform ratings and counts with a combined score. Costs 6 credits. Note: this tool queries multiple review sources and may take 10-30 seconds to return — this is normal, not an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| business_name | Yes | Business name | |
| location | Yes | City and state | |
| platforms | No | Platforms to check. Default: ["google", "trustpilot"] |
Implementation Reference
- src/tools/reviews.ts:61-69 (handler)The handler function that executes the multi_platform_reviews tool logic. Calls the API at /v1/reviews/multi-platform with business_name, location, and optional platforms array, then formats the result.
withErrorHandling(async ({ business_name, location, platforms }) => { const result = await callApi( "/v1/reviews/multi-platform", { business_name, location, ...(platforms && { platforms }) }, getAuth(), 120_000 ); return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] }; }) - src/tools/reviews.ts:55-59 (schema)Zod schema defining the input parameters for the multi_platform_reviews tool: business_name (required string), location (required string), and platforms (optional array of 'google' | 'trustpilot').
{ business_name: z.string().describe("Business name"), location: z.string().describe("City and state"), platforms: z.array(z.enum(["google", "trustpilot"])).optional().describe('Platforms to check. Default: ["google", "trustpilot"]'), }, - src/tools/reviews.ts:52-70 (registration)Registration of the 'multi_platform_reviews' tool via server.tool() within the registerReviewTools function. This is how the tool is registered with the MCP server.
server.tool( "multi_platform_reviews", "Get review data across multiple platforms (Google, Trustpilot). Returns per-platform ratings and counts with a combined score. Costs 6 credits. Note: this tool queries multiple review sources and may take 10-30 seconds to return — this is normal, not an error.", { business_name: z.string().describe("Business name"), location: z.string().describe("City and state"), platforms: z.array(z.enum(["google", "trustpilot"])).optional().describe('Platforms to check. Default: ["google", "trustpilot"]'), }, READ_ONLY, withErrorHandling(async ({ business_name, location, platforms }) => { const result = await callApi( "/v1/reviews/multi-platform", { business_name, location, ...(platforms && { platforms }) }, getAuth(), 120_000 ); return { content: [{ type: "text" as const, text: formatResult(result.data, result) }] }; }) ); - src/server.ts:37-37 (registration)Top-level registration call in createMcpServer that triggers registration of all review tools (including multi_platform_reviews).
registerReviewTools(server, getAuth); - src/api-client.ts:143-158 (helper)Helper wrapper (withErrorHandling) that catches errors thrown by the handler and returns them as MCP error content instead of crashing.
export function withErrorHandling<T>( fn: (args: T) => Promise<ToolResult> ): (args: T) => Promise<ToolResult> { return async (args) => { try { return await fn(args); } catch (err) { const message = err instanceof Error ? err.message : String(err); console.error(`[mcp] Tool error: ${message}`); return { content: [{ type: "text" as const, text: `Error: ${message}` }], isError: true, }; } }; }