draft_test_case_from_conversation
draft_test_case_from_conversation
Drafts a simulation test case from one Conversation. Use it from the MCP Server or from adacli. Both return the same screened draft. The draft holds what the end user said first, what the Agent did, and how the Conversation ended. The MCP server replaces personal details with fake values before the AI assistant receives the draft.
The tool does not save anything. The draft includes step-by-step instructions for the assistant. The assistant writes the test case and shows you a preview. After you confirm, it saves the test case with edit_agent_config. The Test Case From Conversation prompt starts the same flow.
Example prompts
- “Make a test case from conversation 6720f1c2a9b3e4d5f6a7b8c9.”
- “Conversation 6720f1c2a9b3e4d5f6a7b8c9 failed on the refund flow. Turn it into a test case so we catch it next time.”
- “Draft a test case from the last conversation that handed off on a delivery question.”
The tool needs a conversation ID. If the prompt does not include one, the assistant finds it with get_conversations first.
Parameters
Response
The draft includes:
Personal data
The MCP server screens the draft for personal details before it reaches the assistant. Screening is automatic and can miss a detail, and saving the test case does not screen it again. Review the preview before you confirm, and replace any personal detail or credential that remains.
- Fake values: Each personal detail found, such as a name, email address, phone number, or order number, is replaced with a fake value of the same shape. A value found in several places usually gets the same fake value in each. A short number identified only by its field name, such as a card’s expiry month, is replaced in that field only.
- Placeholders: Credentials and references to sensitive values are replaced with a placeholder such as
redacted-1. - Values left out: Sensitive variable values, the inputs of identity verification tools, API tool inputs that the tool’s definition marks sensitive, tool inputs named like a hidden variable, and tool outputs that are redacted or saved to sensitive variables are left out of the draft.
- Conversation text: The instructions tell the assistant to write the test case from the draft only. The assistant can still call
get_conversationfor more context. That tool returns the original, unscreened transcript to your MCP client.
The instructions offer to run the new test case once. An API tool set to Live, the default, sends real requests to your systems during a simulation. Before you agree to a run, set the API tools that the Conversation called to Mock in simulations. See Mock API tools.
Limitations
- One Conversation per call: Each call drafts one test case. Each test case needs its own preview and confirmation before it is saved.
- Rate limit: An Agent can make 6 drafts per minute.
- Size: The tool shortens large tool payloads. It replaces each removed value or entry with
[truncated]. A Conversation too large to screen returns an error, and no draft is made. - Screening required: If personal data cannot be screened, the tool returns an error and makes no draft. Try again later.
- Saving needs write access: The tool only reads. Saving the test case uses
edit_agent_config, which requires an Owner or Admin role when using OAuth. See Permissions.
Use from adacli
adacli returns the same screened draft:
With --json, the command saves nothing. It prints the draft with the same fields as this tool, and instructions with the adacli steps to write, save, and run the test case. An AI coding assistant, such as Claude Code, follows those steps and saves the test case with adacli acme testing cases create --from-json <file> after you confirm.
The command fails with an error and prints no draft in the same cases as this tool: the Conversation is not found, too many drafts were requested in the last minute, or the Conversation could not be screened. The command requires adacli 1.1.7 or later. Earlier releases built the test case from the unscreened transcript.
The --create, --name, and --criteria options are deprecated. --create still saves a basic test case from the screened draft, with a fixed scenario and fixed expected outcomes, and prints a warning. Use the --json flow above instead, so the test case gets a full scenario and expected outcomes.