Modulify

Read the site server logs

get_site_logs

Reads the recent server logs of a site, the same stream the Logs panel shows.

POST /v1/get_site_logsScopelogs:readRead only

Pass preview for the development machine that runs while someone is building, or production for the published site. Up to 300 lines come back newest last, each prefixed with its timestamp where the line carries one. A site with no machine running answers with a single line saying so rather than an error, so open the preview or publish first.

Nothing is stored between calls. The first call after a quiet spell returns only what is in flight at that moment, and the buffer fills toward its cap only while you keep reading, so poll across a few calls rather than expecting one to hold the history.

It answers why a site is erroring, whether an API route ran and what the server printed, so read it after a change rather than guessing from the code. Logs carry whatever the site prints, which can include values read from environment variables, and the tool tells the client never to repeat a log line anywhere it would be published. See Logs.

Request

Call it with a POST to https://api.modulify.ai/v1/get_site_logs, sending the inputs below as a JSON object. The token needs the logs:read scope.

It only reads and changes nothing, so retrying it is safe.

curl -X POST https://api.modulify.ai/v1/get_site_logs \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'

Over MCP, the same method is the get_site_logs tool.

Inputs

Input Type Required Description
projectId string Yes The site id.
environment string No preview for the machine behind the live preview, or production for the published site. Defaults to preview, and any other value is refused before the tool runs.

Response

Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.