project_logs
Tail function logs, read recent runtime output, debug a just-deployed endpoint, see what console.log printed, observability. After every project_deploy / project_patch, it shows what the new code logged on the first few requests — no need to curl the endpoint and guess. Also writes logs (with a message).
Read mode (no message): returns the most recent log lines for the project, newest first. Filter by level, source (server | client | function | job | cron | queue | system | oauth), substring match, or trace ID. Default limit 50, max 500.
Write mode (with message): records a structured log line. Used by your own monitoring code, or by an agent that wants to mark a checkpoint. Writes are durable but ingested asynchronously — a line you just wrote may take a few seconds to appear in a read. queued:true confirms acceptance, not immediate readability.
Example:
// Read recent logs after a deploy:
{ "project_id": "my-saas", "limit": 50 }
// Read only errors:
{ "project_id": "my-saas", "level": "error", "limit": 50 }
// Read logs from one source:
{ "project_id": "my-saas", "source": "server", "search": "/api/checkout" }
// Write (with structured data):
{ "project_id": "my-saas", "message": "Payment processed", "level": "info", "data": "{\"amount\":49.99}" }Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>"
},
"name": "project_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Optional JSON string of structured data (write mode) | |
| level | No | debug | info | warn | error (default info) | |
| limit | No | Max rows (default 50, max 500, read mode) | |
| search | No | Substring match on message (read mode) | |
| source | No | Filter to one source: server | client | function | runtime_console | job | cron | queue | system | oauth (read mode; runtime_console contains production console output) | |
| message | No | Log message. Omitted: logs are read instead of written. | |
| trace_id | No | Optional 32-character trace id. Returns only log lines from that distributed request. | |
| project_id | Yes | Project ID (UUID), subdomain, or slug — resolved server-side, no UUID lookup needed. 'default' also works when the account has exactly one project; multi-project accounts must name one (the error lists them). |