Skip to main content
Glama

get_recitation_url

Retrieve MP3 audio URLs for Quran verse recitations by specifying surah, ayah, and reciter to enable listening to specific verses.

Instructions

Get audio recitation URL for a specific Quran verse. Returns MP3 URL for listening to the verse.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
surahYesSurah number (1-114)
ayahYesAyah (verse) number
reciterNoReciter name (default: Maher_AlMuaiqly_64kbps). Use list_reciters to see all options.Maher_AlMuaiqly_64kbps

Implementation Reference

  • Core handler function that validates surah, ayah, reciter; uses caching; constructs MP3 recitation URL.
    export async function getRecitationURL(
      surah: number,
      ayah: number,
      reciterSlug: string = 'Maher_AlMuaiqly_64kbps'
    ): Promise<RecitationInfo> {
      // Validate inputs
      if (!isValidSurah(surah)) {
        throw new QuranMCPError(
          `Invalid surah number: ${surah}. Must be between 1 and 114.`,
          'INVALID_SURAH'
        );
      }
    
      if (!isValidAyah(surah, ayah)) {
        const surahInfo = getSurahInfo(surah);
        throw new QuranMCPError(
          `Invalid ayah number: ${ayah}. Surah ${surah} has ${surahInfo?.ayahs} ayahs.`,
          'INVALID_AYAH'
        );
      }
    
      // Validate reciter
      const reciter = RECITERS.find(r => r.slug === reciterSlug);
      if (!reciter) {
        throw new QuranMCPError(
          `Unknown reciter: ${reciterSlug}. Available reciters: ${RECITERS.map(r => r.slug).join(', ')}`,
          'INVALID_RECITER'
        );
      }
    
      // Create cache key
      const cacheKey = `recitation:${reciterSlug}:${surah}:${ayah}`;
    
      // Try to get from cache or generate
      return recitationCacheService.getOrSet(cacheKey, async () => {
        // Format numbers with leading zeros
        const surahFormatted = formatSurahNumber(surah);
        const ayahFormatted = formatAyahNumber(ayah);
    
        // Build URL
        const url = `${API_ENDPOINTS.RECITATION}/${reciterSlug}/${surahFormatted}${ayahFormatted}.mp3`;
    
        return {
          surah,
          ayah,
          reciter: reciter.name,
          url,
          format: 'mp3',
        };
      });
  • Tool definition including name, description, and input schema for validation.
    {
      name: 'get_recitation_url',
      description: 'Get audio recitation URL for a specific Quran verse. Returns MP3 URL for listening to the verse.',
      inputSchema: {
        type: 'object',
        properties: {
          surah: {
            type: 'number',
            description: 'Surah number (1-114)',
            minimum: 1,
            maximum: 114,
          },
          ayah: {
            type: 'number',
            description: 'Ayah (verse) number',
            minimum: 1,
          },
          reciter: {
            type: 'string',
            description: 'Reciter name (default: Maher_AlMuaiqly_64kbps). Use list_reciters to see all options.',
            default: 'Maher_AlMuaiqly_64kbps',
          },
        },
        required: ['surah', 'ayah'],
      },
    },
  • Dispatches the tool call in the executeTool switch statement by invoking the handler.
    case 'get_recitation_url': {
      const { surah, ayah, reciter = 'Maher_AlMuaiqly_64kbps' } = args;
      result = await getRecitationURL(surah, ayah, reciter);
      break;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool returns an MP3 URL, which is useful, but doesn't mention other behavioral aspects like whether it requires authentication, has rate limits, caches results, or what happens with invalid inputs. For a tool with zero annotation coverage, this leaves significant gaps in understanding its operational behavior.

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 extremely concise with two sentences that directly state the purpose and output. Every word earns its place—no fluff or redundancy. It's front-loaded with the core function and efficiently adds the output detail.

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

Completeness3/5

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

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is minimally adequate. It covers the purpose and output type but lacks details on error handling, authentication, or usage context. Without annotations or output schema, more behavioral and contextual information would improve completeness for safe and effective use.

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 already fully documents all three parameters (surah, ayah, reciter) with descriptions, constraints, and defaults. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific action ('Get audio recitation URL') and resource ('for a specific Quran verse'), distinguishing it from siblings like get_quran_verse (which likely returns text) or get_full_surah (which might return full surah content). It explicitly mentions the output format ('MP3 URL for listening'), which further clarifies its unique purpose.

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 audio recitation is needed, but doesn't explicitly state when to use this tool versus alternatives like get_quran_verse (which might provide text) or list_reciters (which lists reciters). It mentions list_reciters for reciter options, providing some contextual guidance, but lacks explicit when/when-not instructions or comparisons to similar tools.

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