Skip to main content
Glama

get_full_surah

Retrieve complete Quran chapters with optional English translations by specifying surah numbers. Access full text for study, reference, or recitation purposes.

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

  • Main handler function that implements the get_full_surah tool logic. Fetches all verses of the specified surah, optionally including translation, using cached API fetches and helper functions.
    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;
    }
  • Tool schema definition including input validation, properties, and description for get_full_surah.
    {
      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 in the tool executor switch statement that maps the tool name to the handler function call.
    case 'get_full_surah': {
      const { surah, include_translation = false, translation = 'en.asad' } = args;
      result = await getFullSurah(surah, include_translation, translation);
      break;
    }
  • Import statement registering the getFullSurah handler for use in the executor.
      getFullSurah,
      getQuranVerse,
      getRandomVerse,
      listTranslations
    } from '../tools/quran.js';
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the ability to include translations, which adds some behavioral context, but fails to disclose critical traits like response format (e.g., structured data, pagination), error handling, or performance considerations (e.g., size of output for long surahs). For a read operation with no annotation coverage, this is a significant gap.

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 a single, efficient sentence that front-loads the core purpose ('Get all verses of a complete Surah') and adds a useful detail about translations. There is no wasted text, making it highly concise and well-structured for quick comprehension.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a tool with 3 parameters. It lacks details on return values (e.g., format, structure), error cases, or behavioral constraints, which are essential for an AI agent to use it correctly. The high schema coverage helps, but overall context is insufficient.

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 fully documents parameters (surah number range, translation options). The description adds minimal value beyond the schema by noting translations can be included, but does not explain parameter interactions (e.g., how 'translation' relates to 'include_translation') or provide usage examples. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb 'Get' and the resource 'all verses of a complete Surah (chapter)', specifying it retrieves complete chapters rather than individual verses. It distinguishes from siblings like 'get_quran_verse' (single verse) and 'get_surah_info' (metadata), though not explicitly named. However, it could be more specific about what 'all verses' entails (e.g., Arabic text, numbering).

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

Usage Guidelines3/5

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

The description implies usage when needing a full chapter rather than a single verse (contrasting with 'get_quran_verse'), but does not explicitly state when to use this tool versus alternatives like 'get_surah_info' or 'search_quran'. No guidance on prerequisites or exclusions is provided, leaving usage context partially inferred.

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

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