# Task recipes

Each recipe names the tools in the order an agent calls them. The same calls work over REST
([reference](https://www.closefinch.com/docs/api)).

## Prepare for a meeting

1. `ra_records_list` with `object: "accounts"` and `query.q` set to the company, to get its id.
2. `ra_account_state` for its memory, open decisions and the next best action.
3. `ra_records_timeline` for the latest emails, meetings and notes, each with its source.
4. `ra_graph_neighborhood` for who's involved and how recently they talked.

## Find stalled deals and add follow-ups

1. `ra_ask`: "Which open deals have had no activity in 14 days?" (it answers with the records it used).
2. For each one, `ra_propose` with `crm.task.create` and the deal in `related`. Creating a task happens at
   once and can be undone in the app.

## Log a call

`ra_activities_create` with `type: "call"`, the time, a summary and the contact's id in `record_ids`. It joins
the contact's and the account's timelines.

## Change a record, with approval

`ra_propose` with `crm.record.update`: the change waits in the approval inbox, and the result has the approval's
link for a person to decide. Direct `ra_records_update` is for your own edits, with your key's scopes.

## Check an agent before it's live

1. `ra_agents_draft_from_goal` with the goal in plain language: a draft, not a live agent.
2. `ra_agents_test_run`: a dry run (nothing is sent or changed), with the trace.
3. `ra_evals_add` and `ra_evals_run` to keep it honest after edits.
4. Publish it with `ra_agents_publish`. Any key with `agents:write` can publish, so keep that scope off keys an
   agent holds unless your principal wants it to put agents live.

## Answer a security questionnaire

`ra_questionnaire_answer` with the questions: answers come from approved sources only, each with its citation.
