> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unpage.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Papertrail

Our Papertrail integration allows [Agents](/concepts/agents) to search and analyze
log data from your Papertrail account. (DEPRECATED: SolarWinds has migrated all
Papertrail accounts into SolarWinds Observability)

<AccordionGroup>
  <Accordion title="MCP Tools" icon="wrench">
    * **search\_logs**: Search Papertrail logs within a specified time range
  </Accordion>
</AccordionGroup>

## Prerequisites

<Steps>
  <Step title="Open your Papertrail profile">
    [Log in to your Papertrail account](https://www.papertrail.com/), and then
    go to Settings" > "Profile".
  </Step>

  <Step title="Copy your API Token">
    <img src="https://mintcdn.com/aptible-bot/5SAJPYW5AZAq0sFG/images/papertrail/token.png?fit=max&auto=format&n=5SAJPYW5AZAq0sFG&q=85&s=2a682fee5b91c446f86f441a8a3914ca" alt="Papertrail API Token" width="2732" height="2012" data-path="images/papertrail/token.png" />
  </Step>
</Steps>

## Configuration

Configure the Papertrail plugin by running `uv run unpage configure` or by editing
the `~/.unpage/profiles/<profile_name>/config.yaml` file:

```yaml theme={null}
plugins:
  # ...
  papertrail:
    enabled: true
    settings:
      token: <your papertrail api token> # required
```

Alternatively, you can set the API token as an environment variable:

```bash theme={null}
export PAPERTRAIL_API_TOKEN="your-papertrail-api-token"
```

## Tools

The Papertrail plugin provides the following tools to Agents and MCP Clients:

<Card title="search_logs">
  Search Papertrail for logs within a given time range.

  **Arguments**

  <ParamField path="query" type="string" required>
    The search query. Use Papertrail's search syntax to filter logs by hostname,
    program, message content, or other criteria. For example: "error", "hostname:web01",
    or "program:nginx AND status:500".
  </ParamField>

  <ParamField path="min_time" type="datetime" required>
    The starting time for the search range (ISO 8601 timestamp). Logs generated
    at or after this time will be included in the results.
  </ParamField>

  <ParamField path="max_time" type="datetime" required>
    The ending time for the search range (ISO 8601 timestamp). Logs generated
    at or before this time will be included in the results.
  </ParamField>

  <ParamField path="timeout_seconds" type="integer" default="10">
    The maximum number of seconds to wait for the search to complete. Defaults to 10 seconds.
    Increase this value for more comprehensive results in large log volumes, or decrease it
    for faster response times.
  </ParamField>

  **Returns** `PapertrailSearchResult`: An object containing:

  * `results`: Log events with details including timestamp, hostname, program, message, and metadata.
  * `truncated`: Boolean indicating if results were truncated due to response size limits.
  * `timed_out`: Boolean indicating if the search timed out based on the specified timeout.

  **Note**: Results are automatically truncated if they exceed response size limits to ensure optimal performance.
</Card>
