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

# AddPrompt

> Add chapter content via a prompt

## Overview

Submits a prompt to a chapter, describing what to build. This tool **waits for completion** (unlike the REST API which returns immediately), making it suited for conversational workflows.

<Info>
  This tool polls for up to 30 seconds. If the chapter is still processing after that, you'll get a timeout response and can poll again.
</Info>

## Parameters

<ParamField path="project_id" type="string" required>
  The project ID (e.g., `prj_abc123xyz`)
</ParamField>

<ParamField path="chapter_title" type="string" required>
  The chapter name. The chapter is created if it doesn't already exist.
</ParamField>

<ParamField path="prompt" type="string" required>
  Prompt content describing what to build (1-5000 characters)
</ParamField>

<ParamField path="force" type="boolean">
  If `true`, cancel any in-flight prompt for this chapter and restart (default: `false`)
</ParamField>

## Returns

Returns the chapter status after polling for completion.

## Example Usage

### In Claude

```
For the "Pricing Page Refresh" project, add a chapter called "Launch Ad" and build a 30-second product launch ad from our latest release notes and the new pricing screenshot.
```

```
Add a "Feature Demo" chapter that walks through the new Team plan dashboard, using the screenshots in our brand kit.
```

### Direct Tool Call

```json theme={null}
{
  "name": "AddPrompt",
  "arguments": {
    "project_id": "prj_abc123xyz",
    "chapter_title": "Launch Ad",
    "prompt": "30-second product launch ad for the new Team plan. Pull the headline from our release notes, drop in the updated pricing screenshot, and resolve brand colors and type from the catalog.",
    "force": false
  }
}
```

### Response (Success)

```json theme={null}
{
  "status": "completed",
  "message": "Prompt completed in 47 seconds",
  "chapter": {
    "id": "cht_def456uvw",
    "title": "Launch Ad",
    "status": "completed"
  },
  "elapsed_seconds": 47
}
```

### Response (Timeout)

```json theme={null}
{
  "status": "processing",
  "message": "Prompt is still processing",
  "elapsed_seconds": 30,
  "chapter_id": "cht_def456uvw",
  "chapter_title": "Launch Ad",
  "hint": "Check status again in a few moments, or use force: true to restart if stuck"
}
```

## Writing Effective Prompts

<AccordionGroup>
  <Accordion title="Reference real product surfaces" icon="link">
    ```
    Build the launch chapter using the headline from our latest release notes
    and the new pricing screenshot. Resolve brand from the catalog.
    ```
  </Accordion>

  <Accordion title="Include timing details" icon="clock">
    ```
    15-second social cut:
    - 0-5s: hero shot of the new dashboard
    - 5-10s: the headline from our release notes
    - 10-15s: CTA pulled from the pricing page
    ```
  </Accordion>

  <Accordion title="Describe the output, not the magic" icon="palette">
    ```
    Product launch ad. 30 seconds. 16:9. Modern, on-brand,
    confident pacing. Match the typography and accent color
    in our catalog.
    ```
  </Accordion>

  <Accordion title="Reference uploaded assets" icon="image">
    ```
    Use the pricing screenshot I uploaded earlier and the new
    "Team plan" headline from the latest release note.
    ```
  </Accordion>
</AccordionGroup>

## Common Use Cases

<AccordionGroup>
  <Accordion title="Building chapter content" icon="wand-sparkles">
    ```
    For the "Feature Demo" chapter, walk through the new dashboard using the latest screenshots
    ```
  </Accordion>

  <Accordion title="Iterating on content" icon="rotate">
    ```
    Update the launch ad to lead with the price drop instead of the new feature
    ```
  </Accordion>

  <Accordion title="Batch creation" icon="layer-group">
    ```
    Build content for all five chapters of the launch project
    ```
  </Accordion>
</AccordionGroup>

## Behavior Notes

<Note>
  **Auto-creates chapters:** If a chapter with the specified title doesn't exist, it's created automatically.
</Note>

<Warning>
  **Blocking operation:** This tool waits for completion (up to 30 seconds). For longer processing times, use the REST API's non-blocking approach.
</Warning>

<Tip>
  **Force parameter:** `force: true` cancels an in-flight prompt and restarts. Use sparingly. it interrupts work in progress.
</Tip>

## REST API Equivalent

This tool calls:

1. `POST /api/v1/projects/{projectId}/chapters` (if the chapter doesn't exist)
2. `POST /api/v1/projects/{projectId}/chapters/{chapterId}/prompt`
3. Polls `GET /api/v1/projects/{projectId}/chapters/{chapterId}` for completion

See the [Submit Prompt API documentation](/api-reference/prompts/submit) for more details.
