AI Agent: Allow clients to query errored Open API requests
🔍 Problem Statement
As a client admin, I can only find errored API requests by searching Settings > Logs > Open API by hand, which results in avoidable support tickets.
💡 User Story
As a client admin, I want to ask the Pelcro AI Agent for errored API requests by customer, endpoint, response code or date, so that I can diagnose failures without contacting support.
🎯 Definition of Done (DoD)
Given a site with errored Open API requests (4xx or 5xx), when an admin calls
[clarify endpoint, e.g. GET /api/v1/core/logs/open-api]with a date range, then it returns only that site's errored requests.Given filters (customer ID, request URI, response code, report_id), when applied, then each result matches them and shows the timestamp, request URI, response code, error and customer ID.
Given an admin asks the AI Agent "show 422 errors from the last 7 days", when it answers, then it lists the matching requests and their total count.
Given a user without the admin role, when they ask the AI Agent or call the endpoint, then the request is refused.
Given the release, then the endpoint is documented on docs.pelcro.com and covered by automated tests, and it is exposed as an MCP tool with at least one eval.
This change will impact the API and Integration layers, specifically a new Core API logs endpoint, a new MCP server tool and the AI Agent (
/admin/ai-agent/chat).This solution will include the following limitations: read-only; errored Open API requests only, no successful requests; no real-time alerts; no errors from custom client UI flows or from payments the gateway rejects before they reach Pelcro; history limited to log retention [clarify]; request payloads excluded [clarify].
Log in to comment and vote
No comments yet
Be the first to share your thoughts.