# RevCent MCP Operation: `CreateAIPrompt`

This document explains the `CreateAIPrompt` operation in depth so MCP clients can correctly create AI Prompts in RevCent.

This is an operation-specific MCP guide. It explains required fields, prompt purpose, explicit user-request requirements, validation rules, examples, and common mistakes.

Sources:
- RevCent API/MCP schema for `CreateAIPrompt`

---

## Operation Summary

`CreateAIPrompt` creates an AI Prompt and returns a unique `ai_prompt_id`.

An AI Prompt is saved prompt text that can be reused later when explicitly requested.

The operation requires:

```text
name
prompt
```

---

# Critical Rule: Only Create When Explicitly Asked

MCP should only call `CreateAIPrompt` when the user or MCP client explicitly asks to save a prompt.

Do not create AI Prompts automatically.

Do not create AI Prompts because the MCP thinks a prompt is useful.

Do not create AI Prompts because the user wrote a prompt that seems reusable.

Correct:

```text
Save this as an AI Prompt.
Create an AI Prompt named Weekly Revenue Analysis.
Store this prompt for reuse.
Save the following prompt text.
```

Incorrect:

```text
The prompt seems useful, so I will save it.
The user may need this later, so I will create an AI Prompt.
This task is repeated often, so I will silently store the prompt.
```

---

## Why Explicit Create Permission Matters

Creating saved prompts changes the user’s RevCent account.

A saved prompt may later influence AI or MCP behavior when explicitly used.

Users should control what prompt templates are saved.

MCP should not create prompt clutter or save prompt content without consent.

Rule:

```text
No explicit save request = no CreateAIPrompt call.
```

---

# What AI Prompts Are For

AI Prompts are for frequently reused prompt text.

Examples:

- Reporting prompt templates
- Customer support summary prompts
- Chargeback evidence review prompts
- BigQuery analysis prompts
- Marketing copy prompts
- Product analysis prompts
- Customer segmentation prompts
- Workflow-specific AI instructions
- Reusable MCP client prompts

AI Prompts are not for one-off instructions unless the user explicitly wants to save that one-off instruction.

---

# Required Fields

| Field | Type | Required | Description |
|---|---:|---:|---|
| `name` | string | Yes | AI Prompt name. Maximum 100 characters. |
| `prompt` | string | Yes | AI Prompt text. Maximum 10 KB in size. |

The schema has:

```json
"additionalProperties": false
```

Do not send unknown fields.

---

# `name`

The `name` is the human-readable name of the AI Prompt.

Rules:

- Required.
- Minimum length: 1.
- Maximum length: 100 characters.
- Should clearly describe the reusable prompt.

Good names:

```text
Weekly Revenue Analysis
Customer Support Summary
Chargeback Evidence Review
BigQuery Sales Trend Summary
Failed Renewal Recovery Analysis
VIP Customer Next Action
```

Poor names:

```text
Prompt
Test
Summary
AI
Use This
```

The name should be specific enough that a user or MCP client can explicitly request it later.

---

# `prompt`

The `prompt` field contains the saved AI Prompt text.

Rules:

- Required.
- Minimum length: 1.
- Maximum size: 10 KB.
- Should contain reusable prompt text.
- Should not contain secrets or credentials.

Good prompt content is:

- Clear
- Reusable
- Structured
- Stable
- Easy to understand later
- Specific enough to produce useful output
- General enough to be reused

---

## Prompt Size

The operation schema states:

```text
The AI Prompt text has a maximum 10kb size.
```

MCP should keep prompt text under this limit.

If a prompt is too large, MCP should ask the user to shorten it or split it intentionally.

Do not silently truncate unless the user explicitly approves the truncation.

---

# Sensitive Data Warning

Do not save sensitive secrets in AI Prompts.

Avoid:

- API keys
- Passwords
- Authentication tokens
- Private credentials
- Raw payment card data
- Full credit card numbers
- One-time passcodes
- Customer secrets
- Temporary private values

AI Prompts should store reusable prompt text, not secret data.

---

# Prompt Content Guidance

A good reusable AI Prompt should usually include:

- Task objective
- Input expectations
- Output format
- Important constraints
- Tone/style instructions if relevant
- What to include
- What to avoid
- How to handle missing data

Example reusable reporting prompt:

```text
Analyze the provided ecommerce revenue data. Summarize total revenue, refunds, chargebacks, conversion issues, top-performing products, customer segments, and anomalies. Provide clear recommendations for next actions. Use concise bullet points and call out any data limitations.
```

Example reusable support prompt:

```text
Summarize the customer record for a support agent. Include recent purchases, subscriptions, failed payments, refunds, chargebacks, notes, customer groups, and recommended next action. Keep the summary factual and concise.
```

---

# Human Review Before Creation

When interacting with a human user, MCP should show the final prompt text before saving if the content was generated or modified by the MCP.

Recommended review message:

```text
Here is the AI Prompt I will save. Please review the name and prompt text before I create it.
```

Do not save generated prompt content without giving the user a chance to review unless the user explicitly said to proceed without review.

---

# AI Prompt Usage Guardrail

Creating an AI Prompt does not mean it should be automatically used later.

A saved AI Prompt should only be used when the user or MCP client explicitly asks to use that specific prompt.

Create-time reminder:

```text
Saved AI Prompts are reusable assets. They should not be automatically applied unless explicitly requested.
```

---

# Example Request: Reporting Prompt

```json
{
  "name": "Weekly Revenue Analysis",
  "prompt": "Analyze the provided ecommerce revenue data. Summarize total revenue, refunds, chargebacks, conversion issues, top-performing products, customer segments, and anomalies. Provide clear recommendations for next actions. Use concise bullet points and call out any data limitations."
}
```

---

# Example Request: Customer Support Summary Prompt

```json
{
  "name": "Customer Support Summary",
  "prompt": "Summarize the customer record for a support agent. Include recent purchases, subscriptions, failed payments, refunds, chargebacks, notes, customer groups, and recommended next action. Keep the summary factual and concise."
}
```

---

# Example Request: Chargeback Evidence Review Prompt

```json
{
  "name": "Chargeback Evidence Review",
  "prompt": "Review the supplied chargeback evidence, including customer, sale, transaction, shipping, tracking, fraud detection, and document details. Identify the strongest representment evidence, possible weaknesses, and recommended next action. Do not invent facts not present in the evidence."
}
```

---

# MCP Creation Process

Before calling `CreateAIPrompt`, MCP should verify:

1. The user or client explicitly asked to save/create an AI Prompt.
2. The prompt is intended for reuse.
3. The prompt name is known.
4. The prompt name is clear and under 100 characters.
5. The prompt text is known.
6. The prompt text is under 10 KB.
7. The prompt does not contain secrets or credentials.
8. The prompt is not merely a one-off instruction unless the user explicitly wants it saved.
9. If MCP generated or edited the prompt text, the user had a chance to review it.
10. The user understands the prompt will only be used later when explicitly requested.

---

# Validation Checklist

Before submitting `CreateAIPrompt`:

1. `name` is present.
2. `name` is not empty.
3. `name` is no more than 100 characters.
4. `prompt` is present.
5. `prompt` is not empty.
6. `prompt` is no more than 10 KB.
7. No unknown fields are included.
8. User/client explicitly asked to save the prompt.
9. Prompt appears reusable or the user explicitly wants it saved.
10. Prompt contains no secrets or credentials.
11. Prompt name is descriptive.
12. Prompt text was reviewed when generated by MCP.

---

# Common Mistakes

## Mistake: Creating Without Explicit Request

Wrong:

```text
The user asked for a prompt, so save it automatically.
```

Correct:

```text
Only save it if the user explicitly says to save/create/store it as an AI Prompt.
```

---

## Mistake: Saving One-Off Instructions Without Need

AI Prompts are meant for frequently reused prompts.

Do not save a one-time request unless the user explicitly asks.

---

## Mistake: Saving Secrets

Wrong:

```text
Prompt includes API key or password.
```

Correct:

```text
Do not store secrets in AI Prompts.
```

---

## Mistake: Generic Name

Wrong:

```json
{
  "name": "Prompt"
}
```

Correct:

```json
{
  "name": "Chargeback Evidence Review"
}
```

---

# Output Schema

Successful response:

```json
{
  "api_call_id": "XXXXXXXXXXXXXXXXXXXX",
  "api_call_unix": 1740000000,
  "code": 1,
  "ai_prompt_id": "YYYYYYYYYYYYYYYYYYYY",
  "result": "..."
}
```

| Field | Description |
|---|---|
| `api_call_id` | 20-character API call ID. |
| `api_call_unix` | Unix timestamp when the API call was initiated. |
| `code` | API response code. `1` indicates success. |
| `ai_prompt_id` | 20-character AI Prompt ID created by the operation. |
| `result` | Human-readable result message. |

---

# Quick Reference

Minimum request:

```json
{
  "name": "Customer Support Summary",
  "prompt": "Summarize the customer record for support. Include recent purchases, subscriptions, failed payments, refunds, chargebacks, notes, customer groups, and recommended next action."
}
```

Most important rules:

```text
Only create AI Prompts when explicitly asked.
AI Prompts are for frequently reused prompts.
Do not save secrets.
Use clear names.
Prompt text maximum is 10 KB.
Name maximum is 100 characters.
Creating a prompt does not mean it should be automatically used later.
```


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