Updated Oct 2026
Reviews API for AI agents: tool calling, MCP and safe replies
Reviews are the most useful data an agent can have about a business, and the easiest to get wrong: 58 platforms, five rating scales, replies that can’t be undone. This guide shows three ways to give an agent reviews through Prisma, from zero code (MCP) to full control (your own tools with the OpenAI or Anthropic SDK), and the guardrails that keep an agent from publishing something it shouldn’t. Everything here works with a test key that returns sample reviews.
0. What the agent gets
One JSON for every platform. The fields an agent actually uses:
{
"id": "rev_01KJ8Q2M4T7HX3VB9CWD6NRZ5E", "platform": "app_store", "location_id": "loc_…",
"rating": 2, "title": "Crashes on export", "text": "Since 4.2 the app closes when I export a PDF.",
"author": "mara_k", "language": "en", "created_at": "2026-10-21T08:40:00.000Z",
"reply": null, "url": "https://apps.apple.com/…"
}rating is always 1 to 5 whatever the platform; reply is the business reply with its status; url is where a human can see it. GET /v1/platforms tells the agent which platforms accept replies and how a business connects, with the exact fields to ask for, which is what makes onboarding by an agent possible (for AI agents: connect a platform).
1. Zero code: MCP
If the agent runs in Claude, ChatGPT, Cursor, VS Code or Claude Code, add Prisma’s MCP server and you’re done: nine tools (locations, reviews, stats, connections, platforms, connect links, usage, reply). Setup per client is on the MCP docs; the day-to-day prompts are in reviews in Claude and ChatGPT.
claude mcp add --transport http prisma-reviews https://api.prismareviews.com/mcp --header "Authorization: Bearer pk_test_YOUR_KEY"Agent frameworks that speak MCP (the OpenAI Agents SDK, LangGraph with the MCP adapters, Vercel’s AI SDK) connect to the same URL with the same header.
2. Your own agent: two tools with the OpenAI SDK
pip install openai requestsimport json, os, requests
from openai import OpenAI
API = "https://api.prismareviews.com/v1"
H = {"Authorization": f"Bearer {os.environ['PRISMA_API_KEY']}"}
def list_reviews(platform=None, has_reply=None, since=None, limit=20):
p = {k: v for k, v in dict(platform=platform, has_reply=has_reply, since=since, limit=limit).items() if v is not None}
return requests.get(f"{API}/reviews", headers=H, params=p, timeout=30).json()["data"]
def reply_to_review(review_id, text):
r = requests.post(f"{API}/reviews/{review_id}/reply", headers=H, json={"text": text}, timeout=30)
return r.json() if r.ok else {"error": r.json()}
TOOLS = [
{"type": "function", "function": {"name": "list_reviews", "description": "Reviews of the businesses the user manages, newest first, one JSON for every platform.",
"parameters": {"type": "object", "properties": {
"platform": {"type": "string", "description": "e.g. google_maps, app_store, google_play, trustpilot, yelp"},
"has_reply": {"type": "boolean"}, "since": {"type": "string", "description": "ISO date"}, "limit": {"type": "integer"}}}}},
{"type": "function", "function": {"name": "reply_to_review", "description": "Publish a reply on the platform. Only call after the user approved the exact text.",
"parameters": {"type": "object", "properties": {"review_id": {"type": "string"}, "text": {"type": "string"}}, "required": ["review_id", "text"]}}},
]
FUNCS = {"list_reviews": list_reviews, "reply_to_review": reply_to_review}
client = OpenAI()
messages = [{"role": "system", "content": "You help a business manage its reviews. Never call reply_to_review unless the user has approved the exact text in this conversation."},
{"role": "user", "content": "Which 1- and 2-star reviews from the last 30 days have no reply? Summarise the complaints."}]
while True:
res = client.chat.completions.create(model="gpt-4.1", messages=messages, tools=TOOLS)
msg = res.choices[0].message
messages.append(msg)
if not msg.tool_calls:
print(msg.content); break
for call in msg.tool_calls:
out = FUNCS[call.function.name](**json.loads(call.function.arguments))
messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(out)[:60000]})Filter on the API side (has_reply=false, since) instead of dumping every review into the context; 100 reviews is roughly 15,000 tokens.
3. The same with the Anthropic SDK
pip install anthropic requestsimport anthropic, json
client = anthropic.Anthropic()
TOOLS_A = [{"name": t["function"]["name"], "description": t["function"]["description"], "input_schema": t["function"]["parameters"]} for t in TOOLS]
messages = [{"role": "user", "content": "Draft a reply to the latest 2-star App Store review. Show it to me; don't publish."}]
while True:
res = client.messages.create(model="claude-sonnet-4-5", max_tokens=2000, tools=TOOLS_A, messages=messages,
system="You help a business manage its reviews. Never call reply_to_review unless the user approved the exact text.")
messages.append({"role": "assistant", "content": res.content})
if res.stop_reason != "tool_use":
print(next(b.text for b in res.content if b.type == "text")); break
results = [{"type": "tool_result", "tool_use_id": b.id, "content": json.dumps(FUNCS[b.name](**b.input))[:60000]}
for b in res.content if b.type == "tool_use"]
messages.append({"role": "user", "content": results})4. From the OpenAPI spec
Prisma publishes openapi.json. Frameworks that build tools from a spec (LangChain’s OpenAPI toolkit, Composio, the OpenAI Actions format) can load it directly; keep only GET /v1/reviews, GET /v1/reviews/{id}, GET /v1/stats and POST /v1/reviews/{id}/reply in scope so the agent isn’t tempted to manage connections or webhooks.
5. Guardrails for replies
Prisma publishes exactly the text it receives and never writes a reply itself, so the safety lives in your agent:
- Draft, show, approve, publish. The reply tool’s description says “only after the user approved the exact text”; enforce it in code too: require a flag set by a human step, not by the model.
- Never auto-reply to 1- and 2-star reviews. Route them to a person with the
url. - Platform limits are enforced by Prisma: 350 characters on Google Play, 80 on eBay, 4,096 bytes on Google; a too-long text comes back as
reply_too_longwithmax_length, and read-only platforms asreply_not_supportedwith the link (errors). - Replies are queued and confirmed. Subscribe to
reply.publishedandreply.failedwebhooks and feed the outcome back to the agent or the user. - No PII in replies. Don’t let the agent confirm that someone is a customer or patient; healthcare and legal reviews especially.
- Use the test key while building.
pk_test_…returns sample reviews and accepts replies without publishing anywhere.
What’s true today: replies by API work on the App Store, Google Play, Judge.me, eBay, Trusted Shops, eKomi, WooCommerce, Wix and others; Google Business Profile and Trustpilot join when each approves Prisma’s access (platforms).
FAQ
What’s the fastest way to give an AI agent access to reviews?
Point an MCP-capable client (Claude, ChatGPT, Cursor, Claude Code) at https://api.prismareviews.com/mcp. For your own agent code, define two tools, list_reviews and reply_to_review, that call the REST API; the examples here do it in about 40 lines with the OpenAI and Anthropic SDKs.
Should an agent publish replies automatically?
Only with a human approval step for anything that isn’t a plain thank-you, and never on 1- and 2-star reviews. Prisma publishes exactly the text it receives, so the guardrail has to live in your agent: draft, show, approve, then call the reply tool.
Can an agent get reviews from Google, the App Store and Trustpilot with one tool?
Yes. One list_reviews call returns the same JSON for every platform (rating 1 to 5, text, author, date, reply, url), filterable by platform, location, date and reply status, so the agent reasons over one shape.
Give your agent the reviews, keep the publish button.
2 locations free. Test keys return sample reviews, so the agent runs today.