Skip to main content
Glama

get_full_surah

Retrieve complete Quran chapters with all verses. Optionally include English translations to read full surah content for study or reference.

Instructions

Get all verses of a complete Surah (chapter). Can include translations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
surahYesSurah number (1-114)
include_translationNoWhether to include English translation (default: false)
translationNoTranslation to use if include_translation is true (default: en.asad)en.asad

Implementation Reference

  • Core handler function that implements the get_full_surah tool. Validates surah number, fetches all verses (ayahs) using helper functions getQuranVerse or getQuranArabic, handles optional translation, uses caching internally, and returns array of QuranVerse objects.
    export async function getFullSurah( surah: number, includeTranslation: boolean = false, translationSlug: string = 'en.asad' ): Promise<QuranVerse[]> { if (!isValidSurah(surah)) { throw new QuranMCPError( `Invalid surah number: ${surah}. Must be between 1 and 114.`, 'INVALID_SURAH' ); } const surahInfo = getSurahInfo(surah); if (!surahInfo) { throw new QuranMCPError( `Could not find info for surah ${surah}`, 'SURAH_INFO_NOT_FOUND' ); } const verses: QuranVerse[] = []; for (let ayah = 1; ayah <= surahInfo.ayahs; ayah++) { try { if (includeTranslation) { const verse = await getQuranVerse(surah, ayah, translationSlug); verses.push({ surah, ayah, text: verse.arabic.text, translation: verse.translation.text, }); } else { const verse = await getQuranArabic(surah, ayah); verses.push(verse); } } catch (error) { console.error(`Failed to fetch verse ${surah}:${ayah}:`, error); } } return verses; }
  • MCP tool schema definition including name, description, and inputSchema with properties for surah (required), include_translation, and translation.
    { name: 'get_full_surah', description: 'Get all verses of a complete Surah (chapter). Can include translations.', inputSchema: { type: 'object', properties: { surah: { type: 'number', description: 'Surah number (1-114)', minimum: 1, maximum: 114, }, include_translation: { type: 'boolean', description: 'Whether to include English translation (default: false)', default: false, }, translation: { type: 'string', description: 'Translation to use if include_translation is true (default: en.asad)', default: 'en.asad', }, }, required: ['surah'], }, },
  • Registration and dispatch logic in the central tool executor switch statement. Extracts arguments from input and calls the getFullSurah handler function.
    case 'get_full_surah': { const { surah, include_translation = false, translation = 'en.asad' } = args; result = await getFullSurah(surah, include_translation, 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