Skip to main content
Glama

get_bible_verse_url

Generate direct jw.org URLs for Bible verses to create clickable scripture links in documents. Supports single verses, ranges, and chapter references.

Instructions

Get the jw.org URL for a Bible verse or range of verses. Returns a direct link to view the scripture on jw.org. Supports single verses (e.g., verse: "18"), verse ranges (e.g., verse: "14-16"), and comma-separated verses (e.g., verse: "1,3,5" - will convert to range if contiguous). Use search_bible_books to find book numbers. Perfect for adding clickable scripture links to markdown documents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bookYesBible book number (1-66). Examples: Genesis=1, Psalms=19, Isaiah=23, Matthew=40, Revelation=66. Use search_bible_books to find book numbers.
chapterYesChapter number within the book
verseNoOptional verse reference. Can be: single verse ("18"), verse range ("14-16"), or comma-separated verses ("1,3,5"). If omitted, returns URL for the entire chapter.

Implementation Reference

  • Core handler function that validates Bible reference, handles single verses, ranges, or comma-separated verses, constructs the JW.org finder URL parameter, and returns the direct link.
    export async function getBibleVerseURLImplementation(book, chapter, verse) {
      try {
        // Validate the reference (use verse 1 if no verse provided for validation)
        const verseForValidation = verse ? (verse.toString().split(/[-,]/)[0]) : 1;
        const validation = validateReference(book, chapter, parseInt(verseForValidation));
        if (!validation.valid) {
          return {
            content: [{
              type: 'text',
              text: `Validation error: ${validation.error}`
            }],
            isError: true
          };
        }
    
        // Format book and chapter with zero-padding
        const bookNum = book.toString();
        const chapterNum = chapter.toString().padStart(3, '0');
    
        let bibleParam;
        let verseDisplay;
    
        if (verse) {
          // Parse verse parameter
          const verseStr = verse.toString();
    
          // Check if it contains a comma (multiple verses)
          if (verseStr.includes(',')) {
            const verseArray = verseStr.split(',').map(v => parseInt(v.trim())).sort((a, b) => a - b);
    
            // Check if verses are contiguous
            const isContiguous = verseArray.every((v, i) => i === 0 || v === verseArray[i - 1] + 1);
    
            if (isContiguous && verseArray.length > 1) {
              // Convert to range
              const startVerse = verseArray[0].toString().padStart(3, '0');
              const endVerse = verseArray[verseArray.length - 1].toString().padStart(3, '0');
              bibleParam = `${bookNum}${chapterNum}${startVerse}-${bookNum}${chapterNum}${endVerse}`;
              verseDisplay = `${verseArray[0]}-${verseArray[verseArray.length - 1]}`;
            } else {
              // Use just the first verse for non-contiguous
              const firstVerse = verseArray[0].toString().padStart(3, '0');
              bibleParam = `${bookNum}${chapterNum}${firstVerse}`;
              verseDisplay = verseArray[0].toString();
            }
          }
          // Check if it contains a dash (range)
          else if (verseStr.includes('-')) {
            const [startVerse, endVerse] = verseStr.split('-').map(v => v.trim());
            const startVersePadded = startVerse.padStart(3, '0');
            const endVersePadded = endVerse.padStart(3, '0');
            bibleParam = `${bookNum}${chapterNum}${startVersePadded}-${bookNum}${chapterNum}${endVersePadded}`;
            verseDisplay = `${startVerse}-${endVerse}`;
          }
          // Single verse
          else {
            const versePadded = verseStr.padStart(3, '0');
            bibleParam = `${bookNum}${chapterNum}${versePadded}`;
            verseDisplay = verseStr;
          }
        } else {
          // Chapter only (no verse specified)
          bibleParam = `${bookNum}${chapterNum}`;
          verseDisplay = null;
        }
    
        // Build the jw.org/finder URL
        const url = `https://www.jw.org/finder?wtlocale=E&prefer=lang&bible=${bibleParam}&pub=nwtsty`;
    
        return {
          content: [{
            type: 'text',
            text: url
          }]
        };
    
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error generating Bible verse URL: ${error.message}`
          }],
          isError: true
        };
      }
    }
  • Input schema defining the parameters for the tool: book (number, required), chapter (number, required), verse (string, optional for single/range/comma-separated).
    inputSchema: {
      type: 'object',
      properties: {
        book: {
          type: 'number',
          description: 'Bible book number (1-66). Examples: Genesis=1, Psalms=19, Isaiah=23, Matthew=40, Revelation=66. Use search_bible_books to find book numbers.'
        },
        chapter: {
          type: 'number',
          description: 'Chapter number within the book'
        },
        verse: {
          type: 'string',
          description: 'Optional verse reference. Can be: single verse ("18"), verse range ("14-16"), or comma-separated verses ("1,3,5"). If omitted, returns URL for the entire chapter.'
        }
      },
      required: ['book', 'chapter']
    }
  • Tool registration object exported for use in MCP server, containing name, description, and inputSchema.
    export const getBibleVerseURLTool = {
      name: 'get_bible_verse_url',
      description: 'Get the jw.org URL for a Bible verse or range of verses. Returns a direct link to view the scripture on jw.org. Supports single verses (e.g., verse: "18"), verse ranges (e.g., verse: "14-16"), and comma-separated verses (e.g., verse: "1,3,5" - will convert to range if contiguous). Use search_bible_books to find book numbers. Perfect for adding clickable scripture links to markdown documents.',
      inputSchema: {
        type: 'object',
        properties: {
          book: {
            type: 'number',
            description: 'Bible book number (1-66). Examples: Genesis=1, Psalms=19, Isaiah=23, Matthew=40, Revelation=66. Use search_bible_books to find book numbers.'
          },
          chapter: {
            type: 'number',
            description: 'Chapter number within the book'
          },
          verse: {
            type: 'string',
            description: 'Optional verse reference. Can be: single verse ("18"), verse range ("14-16"), or comma-separated verses ("1,3,5"). If omitted, returns URL for the entire chapter.'
          }
        },
        required: ['book', 'chapter']
      }
    };
  • src/index.js:33-40 (registration)
    Registers the tool by including it in the allTools array returned by the ListToolsRequestHandler in the stdio MCP server.
    const allTools = [
      captionsTool,
      ...workbookTools,
      ...watchtowerTools,
      searchBibleBooksTool,
      getBibleVerseTool,
      getVerseWithStudyTool,
      getBibleVerseURLTool
  • Dispatch logic in the handleScriptureTools function that routes tool calls to the specific implementation.
    case 'get_bible_verse_url':
      return await getBibleVerseURLImplementation(
        args.book,
        args.chapter,
        args.verse
      );
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Since no annotations are provided, the description carries the full burden. It discloses key behavioral traits: it returns a direct link, supports various verse formats (single, range, comma-separated), and converts contiguous comma-separated verses to ranges. However, it doesn't mention error handling, rate limits, or authentication needs, leaving some gaps for a tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the first sentence stating the core purpose. Each subsequent sentence adds useful context without waste, such as usage examples, sibling tool reference, and practical application. No redundant or verbose phrasing is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is largely complete. It covers purpose, usage, and behavioral aspects well. However, it lacks details on output format (e.g., URL structure) and error cases, which could be helpful since there's no output schema. This minor gap prevents a perfect score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by briefly mentioning verse formats and the optional nature of 'verse', but it doesn't provide additional syntax or format details. This meets the baseline of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get the jw.org URL for a Bible verse or range of verses') and distinguishes it from sibling tools by specifying it returns a direct link, unlike tools like 'get_bible_verse' or 'get_verse_with_study' which likely return content. It explicitly mentions the resource (Bible verses on jw.org) and verb (get URL).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('Perfect for adding clickable scripture links to markdown documents') and when to use alternatives ('Use search_bible_books to find book numbers'). It clearly differentiates from siblings by focusing on URL generation rather than content retrieval or search.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/advenimus/jw-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server