Skip to main content

Module service

Module service 

Source
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§

AgentService
IssueRows
One page of the pages of a crawl that fail check.
Quota
Where the caller stands against today’s allowance after a call. None fields mean the plan has no limit (self-hosted).
Reply
A keyed call’s result, with the quota it left behind (None when 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: limit if given, at most MAX_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_id that fail check, limit (clamped) from offset, in crawl order.
parse_check
A check by slug.
parse_severity
critical, warning or notice (lowercase, as the web app’s filters write them).