# RevCent MCP Guide: `SearchPayPalTransactions`

Brief AI/MCP-focused guide for searching RevCent PayPal Transactions.

---

## Operation Summary

Operation:

```text
SearchPayPalTransactions
```

Title:

```text
Search PayPal Transactions
```

Purpose:

```text
Search previously created PayPal Transactions using a search term.
```

Use `SearchPayPalTransactions` when the exact RevCent PayPal Transaction ID is unknown and the user provides a search term such as customer email, customer name, phone, PayPal-generated transaction ID, address, metadata value, or another searchable phrase.

---

## Related Links

| Guide | Link |
|---|---|
| PayPal Transaction Overview | `https://revcent.com/documentation/markdown/mcp/operation/OverviewPayPalTransaction.md` |
| GetPayPalTransaction | `https://revcent.com/documentation/markdown/mcp/operation/GetPayPalTransaction.md` |
| GetPayPalTransactions | `https://revcent.com/documentation/markdown/mcp/operation/GetPayPalTransactions.md` |
| Sale Overview | `https://revcent.com/documentation/markdown/mcp/operation/OverviewSale.md` |
| Pending Refund Overview | `https://revcent.com/documentation/markdown/mcp/operation/OverviewPendingRefund.md` |
| BigQueryRunQuery | `https://revcent.com/documentation/markdown/mcp/operation/BigQueryRunQuery.md` |

---

## When to Use

Use `SearchPayPalTransactions` for targeted lookup when the RevCent PayPal Transaction ID is unknown.

Good search terms may include:

- customer email,
- customer name,
- customer phone,
- customer address,
- PayPal-generated transaction ID,
- PayPal customer ID where indexed,
- metadata value,
- external/customer/internal identifier.

After finding a likely match:

```text
SearchPayPalTransactions
    ↓
Review result/highlights/score
    ↓
GetPayPalTransaction
    ↓
Confirm exact PayPal Transaction before action
```

---

## Input Schema

Required:

| Field | Type | Description |
|---|---:|---|
| `search_term` | string | Single search term or phrase used by the full-text search engine. |

Example:

```json
{
  "search_term": "customer@example.com"
}
```

---

## Output Summary

Search results can include:

| Field | Meaning |
|---|---|
| `item_type` | Always `paypal_transaction`. |
| `id` | 20-character RevCent PayPal Transaction ID. |
| `created_date_unix` | Creation timestamp. |
| `customer_id` | 20-character Customer ID. |
| `first_name` / `last_name` | Customer name. |
| `address_line_1` / `address_line_2` | Customer address lines. |
| `city` / `state` / `zip` | Customer address fields. |
| `email` | Customer email. |
| `phone` | Customer phone. |
| `paypal_transaction_id` | Transaction ID generated by PayPal. |
| `metadata` | Metadata name/value pairs. |
| `url` | Direct RevCent details URL. |
| `highlights` | Fields and values matched by the search. |
| `score` | Search score. Higher means a better match. |

After selecting a likely result, use `GetPayPalTransaction` before providing details or taking action.

---

## Search Safety Rule

Search results are possible matches.

They are not enough to perform consequential actions.

Before discussing PayPal transaction status, initiating/referring a refund, escalating support, or making account/order changes:

```text
SearchPayPalTransactions
    ↓
Select likely result
    ↓
GetPayPalTransaction
    ↓
Confirm customer, PayPal transaction ID, amount, payment context, and related records
    ↓
Only then take action if appropriate
```

Do not take refund/lifecycle actions directly from a search result.

---

## Customer-Facing AI Verification Warning

This operation can help locate sensitive customer, PayPal, order, payment, refund, subscription, trial, shipping, tax, or lifecycle context.

If this operation is used inside a customer-facing AI flow, such as:

- AI Voice Agent,
- public chatbot,
- support chatbot,
- customer portal assistant,
- SMS assistant,
- any visitor-facing AI workflow,

the AI/MCP client should verify the visitor is actually related to the resulting PayPal Transaction before providing information, details, or taking action.

Recommended rule:

```text
Do not provide PayPal Transaction details to a public-facing visitor based only on the search input they supplied.
```

Search inputs can be guessed, mistyped, shared, or discovered. A search result is only a possible match, not proof that the visitor is authorized.

Safe customer-facing flow:

```text
Visitor provides search input
    ↓
AI runs SearchPayPalTransactions
    ↓
AI selects likely result
    ↓
AI runs GetPayPalTransaction for the selected PayPal Transaction
    ↓
AI verifies the visitor against a secondary value from the GetPayPalTransaction response
    ↓
Only after verification:
        provide limited appropriate details
        or take an allowed action
```

Recommended secondary verification values:

| Search Input | Secondary Verification Value |
|---|---|
| Customer name | Customer email or phone from `GetPayPalTransaction`. |
| Customer email | Secondary phone, order-related value, or another record-backed verification value where available. |
| Phone number | Customer email from `GetPayPalTransaction`. |
| PayPal-generated transaction ID | Customer email or phone from `GetPayPalTransaction`. |
| Sale/order/refund context | Customer email or phone from `GetPayPalTransaction`. |
| Metadata/external ID | Customer email or phone from the retrieved PayPal Transaction. |
| RevCent PayPal Transaction ID | Customer email from the retrieved PayPal Transaction. |

Important:

```text
The secondary verification value should come from the retrieved RevCent record, not only from the visitor's original search input.
```

For example, if the visitor searches by PayPal-generated transaction ID, order ID, or name, do not reveal matching PayPal Transaction details until they verify a customer email or another secondary value from `GetPayPalTransaction`.

Do not disclose sensitive details such as:

- PayPal account internals,
- unrelated PayPal transaction details,
- payment processor internals beyond what is appropriate for customer support,
- full payment details,
- unrelated order/subscription/trial details,
- fraud/risk logic,
- full customer details,
- unrelated customer records,
- internal notes not meant for customers,
- other related records unless the visitor is verified and authorized.

For consequential actions, such as refunds, sale voids, subscription changes, shipment changes, dispute handling, or customer outreach, require explicit confirmation and follow the relevant operation-specific safety guidance.


---

## Critical Reporting Rule

This PayPal Transaction lookup/search operation is **not** a reporting tool.

Do not use this operation for:

- counting,
- aggregations,
- metrics,
- reporting,
- data mining,
- bulk retrieval,
- broad analysis,
- document property searches,
- PayPal revenue reports,
- PayPal refund reports,
- PayPal dispute reports,
- PayPal account performance reports,
- campaign/shop/customer PayPal metrics,
- payment-method comparison reports.

Use:

```text
BigQueryRunQuery
```

for those purposes.

Important AI/MCP behavior:

```text
If the AI/MCP client intended to use this operation for reporting, metrics, aggregation, or data mining and then realizes BigQueryRunQuery is the correct operation, it does not need to tell the user about the correction.

It should simply use BigQueryRunQuery instead.
```

The user does not need an explanation that the AI almost used the wrong operation. The correct behavior is to quietly choose the correct operation.


---

## Correct Use vs Incorrect Use

| User Intent | Correct Action |
|---|---|
| “Find the PayPal Transaction for this customer email.” | Use `SearchPayPalTransactions`, then `GetPayPalTransaction`. |
| “Find this PayPal-generated transaction ID.” | Use `SearchPayPalTransactions`, then verify with `GetPayPalTransaction`. |
| “Search for this metadata value.” | Use `SearchPayPalTransactions`, then verify with `GetPayPalTransaction`. |
| “How many PayPal Transactions mention X?” | Use `BigQueryRunQuery`, not `SearchPayPalTransactions`. |
| “Analyze PayPal Transactions by metadata value.” | Use `BigQueryRunQuery`, not `SearchPayPalTransactions`. |
| “Find PayPal revenue by customer source.” | Use `BigQueryRunQuery`, not `SearchPayPalTransactions`. |

---

## Example: Correct Lookup Flow

```text
User: Find the PayPal Transaction for customer@example.com.
```

Correct:

```text
1. SearchPayPalTransactions with search_term = "customer@example.com".
2. Review results.
3. GetPayPalTransaction for the correct result ID.
4. Summarize the exact PayPal Transaction after verification.
```

---

## Example: Incorrect Reporting Flow

```text
User: Search all PayPal Transactions with payment_source=PayPal and tell me revenue.
```

Incorrect:

```text
Use SearchPayPalTransactions repeatedly and aggregate results manually.
```

Correct:

```text
Use BigQueryRunQuery.
```

AI/MCP should simply run `BigQueryRunQuery` without telling the user it changed plans.

---

## Best Practices

1. Use specific search terms.
2. Prefer customer email, phone, PayPal-generated transaction ID, or unique metadata values over broad names.
3. Review `highlights` and `score`.
4. Use `GetPayPalTransaction` after selecting a result.
5. Do not use search results alone for refund or lifecycle actions.
6. Do not use search for reporting or data mining.
7. Verify customer identity with a secondary value from `GetPayPalTransaction` before sharing details in customer-facing AI flows.
8. Use `BigQueryRunQuery` for metrics and analysis.

---

## Final AI/MCP Instruction

Use `SearchPayPalTransactions` only for targeted full-text lookup of PayPal Transactions when the exact RevCent PayPal Transaction ID is unknown.

In customer-facing AI flows, search results are not proof of authorization. After finding a likely match, use `GetPayPalTransaction` and verify the visitor with a secondary value from the retrieved record, such as `customer.email`, before providing details or taking action.

Do not use it for reporting, metrics, aggregation, counting, broad analysis, or data mining. If the user's intent is analytical, silently use `BigQueryRunQuery` instead.


---
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.