get_quran_verse
Retrieve Quran verses with Arabic text and English translation by specifying surah and ayah numbers. Access multiple translation options to study Islamic scripture directly.
Instructions
Get a Quran verse with both Arabic text and English translation. Returns the specified verse from the Quran.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| surah | Yes | Surah number (1-114) | |
| ayah | Yes | Ayah (verse) number within the surah | |
| translation | No | Translation to use (default: en.asad). Options: en.asad, en.sahih, en.pickthall, en.yusufali, en.hilali | en.asad |
Implementation Reference
- src/tools/quran.ts:138-149 (handler)The main handler function that fetches both Arabic text and English translation for a specified Quran verse by calling helper functions getQuranArabic and getQuranTranslation in parallel.export async function getQuranVerse( surah: number, ayah: number, translationSlug: string = 'en.asad' ): Promise<{ arabic: QuranVerse; translation: QuranVerse }> { const [arabic, translation] = await Promise.all([ getQuranArabic(surah, ayah), getQuranTranslation(surah, ayah, translationSlug), ]); return { arabic, translation }; }
- src/shared/tools-definition.ts:10-34 (schema)Defines the tool metadata, description, and input schema (parameters: surah, ayah, translation) for the get_quran_verse tool.name: 'get_quran_verse', description: 'Get a Quran verse with both Arabic text and English translation. Returns the specified verse from the Quran.', inputSchema: { type: 'object', properties: { surah: { type: 'number', description: 'Surah number (1-114)', minimum: 1, maximum: 114, }, ayah: { type: 'number', description: 'Ayah (verse) number within the surah', minimum: 1, }, translation: { type: 'string', description: 'Translation to use (default: en.asad). Options: en.asad, en.sahih, en.pickthall, en.yusufali, en.hilali', default: 'en.asad', }, }, required: ['surah', 'ayah'], }, },
- src/shared/tool-executor.ts:45-49 (registration)Registers and dispatches the get_quran_verse tool execution by extracting arguments and calling the getQuranVerse handler function.case 'get_quran_verse': { const { surah, ayah, translation = 'en.asad' } = args; result = await getQuranVerse(surah, ayah, translation); break; }