# Prompts

Brain's MCP server ships **5 canned prompts** for the most common agent loops. Prompts are pre-templated invocations that combine a question, the right resources to read, and the expected response shape.

| Property           | Value                             |
| ------------------ | --------------------------------- |
| **MCP method**     | `prompts/get` and `prompts/list`  |
| **Required scope** | Same as the underlying read tools |

### Why canned prompts

Most external agents end up reinventing the same five questions in their first day of integration. Canned prompts give them a one-shot way to get a high-quality answer without designing the chain themselves.

| Prompt              | Question It Answers                                                     | Underlying Reads                          |
| ------------------- | ----------------------------------------------------------------------- | ----------------------------------------- |
| `cash_flow_summary` | "What's our cash position right now and over the last 30 days?"         | accounts, balances, transactions          |
| `bills_due`         | "What bills are coming due in the next N days, in priority order?"      | obligations, counterparties               |
| `spending_change`   | "What changed in our spending versus the prior period?"                 | transactions, categories                  |
| `invoice_status`    | "What invoices are outstanding, and which are overdue?"                 | invoices, transactions, counterparties    |
| `subscriptions`     | "What recurring subscriptions are we paying for, and which are unused?" | obligations, transactions, counterparties |

### Anatomy of a prompt

A prompt is a structured object that tells the agent's LLM how to use Brain's MCP surface to answer a specific class of question.

```json
{
  "name": "cash_flow_summary",
  "description": "Summarize the tenant's cash position and 30-day cash flow.",
  "arguments": [
    {
      "name": "tenant_id",
      "description": "The tenant whose cash flow to summarize.",
      "required": true
    },
    {
      "name": "days",
      "description": "Lookback window in days. Default 30.",
      "required": false
    }
  ]
}
```

### `cash_flow_summary`

Pulls all active accounts, fetches the latest balances, lists transactions in the lookback window grouped by direction (`inflow` vs `outflow`), and returns a structured summary plus a narrative.

Typical inputs:

```json
{ "tenant_id": "acme", "days": 30 }
```

Typical output sections:

| Section             | Content                                                   |
| ------------------- | --------------------------------------------------------- |
| **Cash position**   | Sum of `current_balance` across active accounts           |
| **30-day inflows**  | Total inflows, top 5 sources                              |
| **30-day outflows** | Total outflows, top 5 destinations                        |
| **Net change**      | Inflows minus outflows                                    |
| **Anomalies**       | Flagged transactions over the agent's heuristic threshold |
| **Evidence**        | Ledger transaction ids cited                              |

### `bills_due`

Lists obligations with `status in (upcoming, due, overdue)` ordered by `due_date`, with priority hints based on amount, counterparty risk, and days-until-due.

Typical inputs:

```json
{ "tenant_id": "acme", "horizon_days": 14 }
```

Each entry includes the `obligation_id`, `amount_due`, `due_date`, `counterparty.name`, `counterparty.verified_status`, and a recommended action: `pay_now`, `schedule`, `review`, or `escalate`.

{% hint style="info" %}
The recommendation is generated by the calling agent, not by Brain. Brain returns the structured facts; the agent's reasoning produces the priority order.
{% endhint %}

### `spending_change`

Compares two periods (default: current month vs prior month) and surfaces the categories with the largest delta.

Typical inputs:

```json
{
  "tenant_id":  "acme",
  "current_period":  "2025-09",
  "compare_period":  "2025-08"
}
```

Returns categories sorted by absolute change, with citations to specific transactions and counterparties driving the change.

### `invoice_status`

Lists invoices with their `status`, `amount_due` versus `amount_paid`, and aging buckets.

Typical inputs:

```json
{ "tenant_id": "acme" }
```

Aging buckets: `current`, `1-30 days`, `31-60 days`, `61-90 days`, `90+ days`. Each invoice includes `linked_transaction_ids[]` so the agent can verify partial payments.

### `subscriptions`

Identifies recurring obligations and pairs them with usage signals where available.

Typical inputs:

```json
{ "tenant_id": "acme", "min_recurrence_count": 3 }
```

Returns each subscription's `counterparty`, `monthly_amount`, `start_date`, `last_charge`, `recurrence`, and a `freshness` signal computed from related Raw evidence (e.g., when the agent has contributed usage transcripts via `raw.contribute`, those are surfaced here).

### Listing and getting prompts

```http
POST /v1/agents/mcp HTTP/1.1
{ "jsonrpc": "2.0", "id": 1, "method": "prompts/list" }
```

```http
POST /v1/agents/mcp HTTP/1.1
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "prompts/get",
  "params": {
    "name": "cash_flow_summary",
    "arguments": { "tenant_id": "acme", "days": 30 }
  }
}
```

The `prompts/get` response contains a `messages[]` array suitable for direct injection into an LLM's context window. The agent runtime can render the messages, execute the embedded tool calls (Brain returns them with the right URIs and arguments pre-filled), and produce the final answer.

### Audit

Like tools and resources, every `prompts/get` invocation emits an `agent.mcp.tool_called` audit event with `method: "prompts/get"` and the prompt name plus arguments in `inputs`.

### What's next

<table data-view="cards"><thead><tr><th></th><th></th><th data-type="content-ref"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>🛠️ Tools</strong></td><td>The 10 tools the prompts orchestrate.</td><td><a href="/pages/LEWpOYJSpmIuTr20aNe8">/pages/LEWpOYJSpmIuTr20aNe8</a></td><td></td></tr><tr><td><strong>📦 Resources</strong></td><td>The 5 resource templates prompts can reference.</td><td><a href="/pages/L2DEzPLxdznDACZBKJEr">/pages/L2DEzPLxdznDACZBKJEr</a></td><td></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.brain.fi/mcp-server/prompts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
