---
title: Agents that quote scripture
description: Give an assistant or voice agent a tool that returns the exact text of a passage, so it quotes scripture instead of recalling it.
---

# Agents that quote scripture

Ask a chat assistant for "something about fear" and it will often answer with a verse from memory. Most of the time it is close. Sometimes a word has changed, two verses have merged, or the reference points somewhere else. For scripture, close is not good enough.

The fix is to stop asking the model to remember. Give it a tool that finds the passage and returns its exact words, and tell it to quote what comes back. The model still does what it is good at, understanding the person and choosing what to say. The text itself comes from the source, word for word, with its reference.

## A tool for any agent

Most tool-calling APIs take a name, a description and a schema for the input. This one works as it is; rename `input_schema` to `parameters` where your API asks for that.

```json
{
  "name": "find_passage",
  "description": "Find Bible passages for a feeling, a topic or a reference, such as 'something for fear' or 'Psalm 23'. Returns the passage text from the World English Bible. When you use a passage, quote its text exactly as returned and say its reference; never paraphrase scripture or quote it from memory.",
  "input_schema": {
    "type": "object",
    "properties": {
      "query": { "type": "string", "description": "A feeling, a topic, a few words from the passage, or a reference." },
      "limit": { "type": "integer", "minimum": 1, "maximum": 5, "description": "How many passages to return." }
    },
    "required": ["query"]
  }
}
```

The description does two jobs. It tells the model when the tool helps, and it tells the model how to use what comes back. Say the same in your system prompt, so the rule holds for the whole conversation.

## Running the tool

When the model calls `find_passage`, your server calls [search](/api/search) with its own key and hands back only what the model needs: each passage's reference, the line saying where it sits and who is speaking, and its words.

```js
export async function findPassage({ query, limit = 3 }) {
  const res = await fetch('https://play.fellowverse.app/v1/search', {
    method: 'POST',
    headers: {
      authorization: `Bearer ${process.env.FELLOWVERSE_KEY}`,
      'content-type': 'application/json',
    },
    body: JSON.stringify({ query, limit: Math.min(Math.max(limit, 1), 5) }),
  });
  const body = await res.json();
  if (!res.ok) return { error: body.error.problem, fix: body.error.fix };
  return {
    translation: body.translation,
    passages: body.results.map((p) => ({
      reference: p.reference,
      context: p.contextLine,
      text: p.verses.map((v) => v.text).join(' '),
    })),
  };
}
```

A failed call goes back to the model as a plain reason and a fix, so it can tell the person what happened or try a different query, rather than filling the gap from memory.

What the model sees is short and complete:

```json
{
  "translation": "World English Bible (public domain)",
  "passages": [
    {
      "reference": "1 John 4:18-21",
      "context": "...",
      "text": "There is no fear in love; but perfect love casts out fear..."
    }
  ]
}
```

The context line matters as much as the text. It tells the model who is speaking and to whom, so an answer can say "Jesus says to his disciples" rather than guessing.

## Voice agents

A spoken conversation adds two moments worth handling.

- **A spoken request.** When someone asks out loud, the agent's own speech recognition turns it into text, and the same tool finds the passage. If your agent takes audio directly, [voice search](/guides/voice-search) takes the recording and returns what was heard with the passages.
- **A reading.** When someone reads a passage aloud, perhaps to practise it or to ask about it, the agent can know exactly what they read. Upload the turn's audio and start an [alignment](/guides/alignment) without text: the passage is found from what was said, with its reference. Run it alongside the conversation, and when it returns, the agent can answer "That was Psalm 23, verses 1 to 4" and quote it back.

## Beyond the Bible

The pattern holds for any text whose exact words matter: a liturgy, a creed, a policy, a statute, a contract. Keep the text behind a tool, let the model choose and explain, and have it quote what the tool returns. The model stays conversational and the words stay exact.

## For your coding assistant

These docs are written to be read by assistants as well as people.

- **[llms-index.txt](/llms-index.txt)** lists every page with its size, for an assistant to choose what to read.
- **[llms-full.txt](/llms-full.txt)** is the whole site as one file, to paste into a conversation or a project.
- **An MCP server** at `/mcp` on this site gives an assistant three tools, `search_docs`, `read_page` and `list_pages`, so it can look things up while it writes your integration. Add the address to any MCP client that takes a streamable HTTP server.

See [Keep your key on your server](/guides/server-relay) for where the tool's key belongs, and [Handle errors and retries](/guides/errors) for the codes a failed call can return.
