get_quran_verse
Retrieve Quran verses with Arabic text and English translation by specifying surah and ayah numbers. Access multiple translation options for studying Islamic texts.
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 the specified Quran verse using helper functions getQuranArabic and getQuranTranslation.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 name, description, and input schema (parameters: surah, ayah, optional translation) for get_quran_verse.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)The switch case in the tool executor that destructures arguments and calls the getQuranVerse handler function to execute the tool.case 'get_quran_verse': { const { surah, ayah, translation = 'en.asad' } = args; result = await getQuranVerse(surah, ayah, translation); break; }