Expand description
The agent API’s one service layer. The REST routes (/api/v1) and the cloud MCP tools both
call these methods, so they return the same JSON (codoseo_mcp::cloud::types) and charge
the same daily quota.
Every keyed method takes the already-authenticated ApiCaller, counts one call against
the account’s allowance first (a refused call counts nothing), and only then looks at its
arguments. Arguments arrive as the strings a caller sent (ids, check slugs, severities) and
are validated here, after the charge, so a malformed call costs the same as any other.
Another account’s site is the same NotFound as an unknown id.
Structs§
- Agent
Service - Issue
Rows - One page of the pages of a crawl that fail
check. - Quota
- Where the caller stands against today’s allowance after a call.
Nonefields mean the plan has no limit (self-hosted). - Reply
- A keyed call’s result, with the quota it left behind (
Nonewhen the charge itself failed on a database error). The REST layer puts the quota in headers; MCP only needs the outcome.
Constants§
- DEFAULT_
LIMIT - Rows a list returns when the caller doesn’t say.
- MAX_
LIMIT - The most rows one call returns.
Functions§
- clamp_
limit - How many rows a list call returns:
limitif given, at mostMAX_LIMIT, at least 1. - crawl_
health - A finished crawl’s score, counts and failing checks (most severe first, with example URLs fetched in one query). It reads the crawl only, so it serves any crawl id the caller is already allowed to see, a site’s or a quick audit’s.
- issue_
page - The pages of
crawl_idthat failcheck,limit(clamped) fromoffset, in crawl order. - parse_
check - A check by slug.
- parse_
severity critical,warningornotice(lowercase, as the web app’s filters write them).