> For the complete documentation index, see [llms.txt](https://docs.brain.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.brain.fi/mcp-server/prompts.md).

# 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                          |
| --------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------- |
| `wiki.question.cash_flow_summary` | "What's our cash position right now and over the last 30 days?"         | accounts, balances, transactions          |
| `wiki.question.bills_due`         | "What bills are coming due in the next N days, in priority order?"      | obligations, counterparties               |
| `wiki.question.spending_change`   | "What changed in our spending versus the prior period?"                 | transactions, categories                  |
| `wiki.question.invoice_status`    | "What invoices are outstanding, and which are overdue?"                 | invoices, transactions, counterparties    |
| `wiki.question.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": "wiki.question.cash_flow_summary",
  "description": "Ask Brain to summarize cash flow over a period.",
  "arguments": [
    {
      "name": "period",
      "description": "A human-readable period, e.g. 'this month', 'Q1 2026', '2026-04'.",
      "required": true
    }
  ]
}
```

### `wiki.question.cash_flow_summary`

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

Typical inputs:

```json
{ "period": "this month" }
```

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                              |

### `wiki.question.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
{ "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 %}

### `wiki.question.spending_change`

Compares the given period against the prior comparable period and surfaces the categories with the largest delta.

Typical inputs:

```json
{ "period": "2025-09" }
```

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

### `wiki.question.invoice_status`

Reports the status of a specific invoice: whether it has been paid in full, partially, or not at all, with the linked transactions cited.

Typical inputs:

```json
{ "invoice_number": "INV-1042" }
```

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.

### `wiki.question.subscriptions`

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

This prompt takes no arguments.

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": "wiki.question.cash_flow_summary",
    "arguments": { "period": "this month" }
  }
}
```

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 16 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 7 resource templates prompts can reference.</td><td><a href="/pages/L2DEzPLxdznDACZBKJEr">/pages/L2DEzPLxdznDACZBKJEr</a></td><td></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
