# RevCent MCP Guide: `GetSiteLogs`

Brief MCP-focused guide for RevCent MCP clients and agents using the `GetSiteLogs` operation.

---

## Operation Summary

Operation:

```text
GetSiteLogs
```

Purpose:

```text
Return runtime log entries for one RevCent Site and one branch over a bounded date range.
```

Use `GetSiteLogs` for focused troubleshooting when the user asks about a specific Site branch.

---

## When to Use

Good uses:

- inspect errors from the dev branch after a test change,
- inspect live branch logs for a specific time window,
- troubleshoot a checkout, product page, cart, or lander issue,
- summarize recent runtime log entries for one Site branch,
- compare user-reported behavior against log timestamps.

Do not use `GetSiteLogs` for broad analytics, exports, or multi-Site monitoring.

---

## Input Schema

`GetSiteLogs` accepts required query parameters.

```json
{
  "date_start": 1710000000,
  "date_end": 1710086400,
  "limit": 25,
  "page": 1,
  "site_filter": [
    "XXXXXXXXXXXXXXXXXXXX"
  ],
  "site_branch_filter": [
    "dev"
  ]
}
```

There is no single-log retrieval operation for Site Logs. Use the returned `results` array from `GetSiteLogs` as the authoritative log output.

### Required Fields

| Field | Type | Required | Description |
|---|---:|---:|---|
| `date_start` | `integer` | Yes | Date range start as a Unix timestamp in seconds. |
| `date_end` | `integer` | Yes | Date range end as a Unix timestamp in seconds. |
| `limit` | `integer` | Yes | Number of log entries to return. Must be between `1` and `25`. |
| `page` | `integer` | Yes | Page number for pagination. |
| `site_filter` | `array<string>` | Yes | Exactly one 20-character Site ID. |
| `site_branch_filter` | `array<string>` | Yes | Exactly one branch name: `main` or `dev`. |

### Important Schema Rules

- The date range cannot exceed 30 days.
- `limit` cannot exceed `25`.
- `site_filter` must contain exactly one Site ID.
- `site_branch_filter` must contain exactly one value.
- `site_branch_filter` must be `main` or `dev`.
- Keep pagination bounded.

---

## Output Summary

A successful response returns pagination fields and a `results` array of log entries.

Important log fields include:

| Field | Meaning |
|---|---|
| `timestamp` | ISO8601 timestamp for the log entry. |
| `id` | Unique log entry identifier. |
| `entry` | Log message text. |

Logs may include operational messages from the deployed Site. Summarize only what is relevant to the user's request and avoid exposing sensitive details unnecessarily.

---

## Example Request for Dev Logs

```json
{
  "date_start": 1710000000,
  "date_end": 1710086400,
  "limit": 10,
  "page": 1,
  "site_filter": [
    "XXXXXXXXXXXXXXXXXXXX"
  ],
  "site_branch_filter": [
    "dev"
  ]
}
```

---

## Example Request for Main Logs

```json
{
  "date_start": 1710000000,
  "date_end": 1710086400,
  "limit": 10,
  "page": 1,
  "site_filter": [
    "XXXXXXXXXXXXXXXXXXXX"
  ],
  "site_branch_filter": [
    "main"
  ]
}
```

---

## Recommended Follow-Up

Use returned logs alongside:

- `GetSite` for current branch and routing status,
- `GetSiteEvents` for recent deployment or catalog activity,
- user-provided timestamps, URLs, product IDs, or checkout details.

When summarizing logs, include:

- branch,
- date range,
- relevant timestamps,
- concise findings,
- next recommended action when clear.

---

## Best Practices

1. Confirm whether the user means `dev` or `main`.
2. Use the narrowest useful date range.
3. Retrieve logs for one Site and one branch at a time.
4. Avoid displaying sensitive log content unnecessarily.
5. Do not treat absence of logs as proof that no issue exists.
6. Use `GetSiteEvents` for deployment/catalog timeline questions.
7. Do not use Site Logs as a reporting or analytics data source.

---

## Final MCP Instruction

Use `GetSiteLogs` only for focused runtime troubleshooting of one RevCent Site branch over a bounded date range.


---
Document Parent Directory
* [Operations](https://revcent.com/documentation/markdown/mcp/operation/index.md) - AI/MCP details and overviews for operations available within the RevCent MCP.