# RevCent MCP Guide: `SearchTrials`

Brief AI/MCP-focused guide for searching RevCent Trials.

---

## Operation Summary

Operation:

```text
SearchTrials
```

Purpose:

```text
Search previously created Trials using a search term.
```

Use `SearchTrials` when the exact Trial ID is unknown and the user provides a search term such as customer email, customer name, phone, address, status, metadata value, or another searchable phrase.

---

## Related Links

| Guide | Link |
|---|---|
| Trial Overview | `https://revcent.com/documentation/markdown/mcp/operation/OverviewTrial.md` |
| GetTrial | `https://revcent.com/documentation/markdown/mcp/operation/GetTrial.md` |
| GetTrials | `https://revcent.com/documentation/markdown/mcp/operation/GetTrials.md` |
| CancelTrial | `https://revcent.com/documentation/markdown/mcp/operation/CancelTrial.md` |
| ExpireTrial | `https://revcent.com/documentation/markdown/mcp/operation/ExpireTrial.md` |
| ExtendTrial | `https://revcent.com/documentation/markdown/mcp/operation/ExtendTrial.md` |
| ShortenTrial | `https://revcent.com/documentation/markdown/mcp/operation/ShortenTrial.md` |
| BigQueryRunQuery | `https://revcent.com/documentation/markdown/mcp/operation/BigQueryRunQuery.md` |

---

## When to Use

Use `SearchTrials` for targeted lookup when the Trial ID is unknown.

Good search terms:

- customer email,
- customer name,
- customer phone,
- address,
- Trial status,
- metadata value,
- external/customer/internal identifier.

After finding a likely match:

```text
SearchTrials
    ↓
Review result/highlights/score
    ↓
GetTrial
    ↓
Confirm exact Trial 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 `trial`. |
| `id` | 20-character Trial ID. |
| `created_date_unix` | Trial creation timestamp. |
| `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. |
| `status` | Trial current status. |
| `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. |

---

## Search Safety Rule

Search results are possible matches.

They are not enough to perform consequential actions.

Before cancelling, expiring, extending, shortening, or discussing sensitive Trial context:

```text
SearchTrials
    ↓
Select likely result
    ↓
GetTrial
    ↓
Confirm customer, Trial status, dates, and related records
    ↓
Only then take action if appropriate
```

Do not cancel, expire, extend, or shorten a Trial directly from a search result.

---

## Customer-Facing AI Verification Warning

This operation can help locate sensitive customer, Trial, payment, subscription, shipment, 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 Trial before providing details or taking action.

Recommended rule:

```text
Do not provide Trial 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 SearchTrials
    ↓
AI selects likely result
    ↓
AI runs GetTrial for the selected Trial
    ↓
AI verifies the visitor against a secondary value from the GetTrial 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 `GetTrial`. |
| Customer email | Secondary phone, order-related value, or another record-backed verification value where available. |
| Phone number | Customer email from `GetTrial`. |
| Metadata/external ID | Customer email or phone from the retrieved Trial. |
| Trial ID | Customer email from the retrieved Trial. |

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 name or metadata value, do not reveal matching Trial details until they verify a customer email or another secondary value returned by `GetTrial`.

Do not disclose sensitive details such as:

- payment details,
- subscription details,
- shipment details,
- tax details,
- fraud/risk logic,
- unrelated customer details,
- internal notes not meant for customers,
- other related records unless the visitor is verified and authorized.

For consequential actions, such as `CancelTrial`, `ExpireTrial`, `ExtendTrial`, or `ShortenTrial`, require stronger confirmation and follow the relevant operation-specific safety guidance.


---

## Critical Reporting Rule

This Trial 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,
- Trial conversion reports,
- Trial cancellation reports,
- Trial expiration reports,
- Trial revenue summaries,
- Trial salvage recovery reports,
- product/campaign/shop performance metrics.

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 Trial for this customer email.” | Use `SearchTrials`, then `GetTrial`. |
| “Find the Trial for this customer name.” | Use `SearchTrials`, then verify with `GetTrial`. |
| “Search for this metadata value.” | Use `SearchTrials`, then verify with `GetTrial`. |
| “How many Trials mention X?” | Use `BigQueryRunQuery`, not `SearchTrials`. |
| “Analyze Trials by metadata value.” | Use `BigQueryRunQuery`, not `SearchTrials`. |
| “Find trial cancellation rate by customer source.” | Use `BigQueryRunQuery`, not `SearchTrials`. |

---

## Example: Correct Lookup Flow

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

Correct:

```text
1. SearchTrials with search_term = "customer@example.com".
2. Review results.
3. GetTrial for the correct result ID.
4. Summarize the exact Trial.
```

---

## Example: Incorrect Reporting Flow

```text
User: Search all Trials with utm_source=google and tell me conversion rate.
```

Incorrect:

```text
Use SearchTrials 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, or unique metadata values over broad names.
3. Review `highlights` and `score`.
4. Use `GetTrial` after selecting a result.
5. Do not use search results alone for Trial mutations.
6. Do not use search for reporting or data mining.
7. Verify customer identity with a secondary value from `GetTrial` before sharing details in customer-facing AI flows.
8. Use `BigQueryRunQuery` for metrics and analysis.

---

## Final AI/MCP Instruction

Use `SearchTrials` only for targeted full-text lookup of Trials when the exact Trial ID is unknown.

In customer-facing AI flows, search results are not proof of authorization. After finding a likely match, use `GetTrial` 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.