Skip to main content
Glama

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
NameRequiredDescriptionDefault
surahYesSurah number (1-114)
ayahYesAyah (verse) number within the surah
translationNoTranslation to use (default: en.asad). Options: en.asad, en.sahih, en.pickthall, en.yusufali, en.hilalien.asad

Implementation Reference

  • 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 };
    }
  • 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'],
      },
    },
  • 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;
    }

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/Prince77-7/quranMCP'

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