Skip to main content
Glama

get_surah_info

Retrieve detailed information about Quran chapters, including name, verse count, and revelation type, by specifying the surah number.

Instructions

Get information about a Surah (chapter) including name, number of verses, and revelation type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
surahYesSurah number (1-114)

Implementation Reference

  • The main handler function for the 'get_surah_info' tool. It retrieves Surah information by looking up the surah number in the SURAH_INFO constant array.
    export function getSurahInfo(surah: number) {
      return SURAH_INFO.find(s => s.number === surah);
    }
  • Input schema definition for the get_surah_info tool, specifying the required 'surah' parameter with validation constraints.
      inputSchema: {
        type: 'object',
        properties: {
          surah: {
            type: 'number',
            description: 'Surah number (1-114)',
            minimum: 1,
            maximum: 114,
          },
        },
        required: ['surah'],
      },
    },
  • Tool registration in the tools definition array, including name, description, and input schema for MCP tool serving.
    {
      name: 'get_surah_info',
      description: 'Get information about a Surah (chapter) including name, number of verses, and revelation type.',
      inputSchema: {
        type: 'object',
        properties: {
          surah: {
            type: 'number',
            description: 'Surah number (1-114)',
            minimum: 1,
            maximum: 114,
          },
        },
        required: ['surah'],
      },
    },
  • Dispatch logic in the tool executor switch statement that routes 'get_surah_info' calls to the getSurahInfo handler function.
    case 'get_surah_info': {
      const { surah } = args;
      result = getSurahInfo(surah);
      break;
  • Constant data structure providing detailed information for all 114 Quran Surahs, directly used by the getSurahInfo handler.
    export const SURAH_INFO = [
      { number: 1, name: 'Al-Fatihah', ayahs: 7, type: 'Meccan' },
      { number: 2, name: 'Al-Baqarah', ayahs: 286, type: 'Medinan' },
      { number: 3, name: 'Ali \'Imran', ayahs: 200, type: 'Medinan' },
      { number: 4, name: 'An-Nisa', ayahs: 176, type: 'Medinan' },
      { number: 5, name: 'Al-Ma\'idah', ayahs: 120, type: 'Medinan' },
      { number: 6, name: 'Al-An\'am', ayahs: 165, type: 'Meccan' },
      { number: 7, name: 'Al-A\'raf', ayahs: 206, type: 'Meccan' },
      { number: 8, name: 'Al-Anfal', ayahs: 75, type: 'Medinan' },
      { number: 9, name: 'At-Tawbah', ayahs: 129, type: 'Medinan' },
      { number: 10, name: 'Yunus', ayahs: 109, type: 'Meccan' },
      { number: 11, name: 'Hud', ayahs: 123, type: 'Meccan' },
      { number: 12, name: 'Yusuf', ayahs: 111, type: 'Meccan' },
      { number: 13, name: 'Ar-Ra\'d', ayahs: 43, type: 'Medinan' },
      { number: 14, name: 'Ibrahim', ayahs: 52, type: 'Meccan' },
      { number: 15, name: 'Al-Hijr', ayahs: 99, type: 'Meccan' },
      { number: 16, name: 'An-Nahl', ayahs: 128, type: 'Meccan' },
      { number: 17, name: 'Al-Isra', ayahs: 111, type: 'Meccan' },
      { number: 18, name: 'Al-Kahf', ayahs: 110, type: 'Meccan' },
      { number: 19, name: 'Maryam', ayahs: 98, type: 'Meccan' },
      { number: 20, name: 'Taha', ayahs: 135, type: 'Meccan' },
      { number: 21, name: 'Al-Anbya', ayahs: 112, type: 'Meccan' },
      { number: 22, name: 'Al-Hajj', ayahs: 78, type: 'Medinan' },
      { number: 23, name: 'Al-Mu\'minun', ayahs: 118, type: 'Meccan' },
      { number: 24, name: 'An-Nur', ayahs: 64, type: 'Medinan' },
      { number: 25, name: 'Al-Furqan', ayahs: 77, type: 'Meccan' },
      { number: 26, name: 'Ash-Shu\'ara', ayahs: 227, type: 'Meccan' },
      { number: 27, name: 'An-Naml', ayahs: 93, type: 'Meccan' },
      { number: 28, name: 'Al-Qasas', ayahs: 88, type: 'Meccan' },
      { number: 29, name: 'Al-\'Ankabut', ayahs: 69, type: 'Meccan' },
      { number: 30, name: 'Ar-Rum', ayahs: 60, type: 'Meccan' },
      { number: 31, name: 'Luqman', ayahs: 34, type: 'Meccan' },
      { number: 32, name: 'As-Sajdah', ayahs: 30, type: 'Meccan' },
      { number: 33, name: 'Al-Ahzab', ayahs: 73, type: 'Medinan' },
      { number: 34, name: 'Saba', ayahs: 54, type: 'Meccan' },
      { number: 35, name: 'Fatir', ayahs: 45, type: 'Meccan' },
      { number: 36, name: 'Ya-Sin', ayahs: 83, type: 'Meccan' },
      { number: 37, name: 'As-Saffat', ayahs: 182, type: 'Meccan' },
      { number: 38, name: 'Sad', ayahs: 88, type: 'Meccan' },
      { number: 39, name: 'Az-Zumar', ayahs: 75, type: 'Meccan' },
      { number: 40, name: 'Ghafir', ayahs: 85, type: 'Meccan' },
      { number: 41, name: 'Fussilat', ayahs: 54, type: 'Meccan' },
      { number: 42, name: 'Ash-Shuraa', ayahs: 53, type: 'Meccan' },
      { number: 43, name: 'Az-Zukhruf', ayahs: 89, type: 'Meccan' },
      { number: 44, name: 'Ad-Dukhan', ayahs: 59, type: 'Meccan' },
      { number: 45, name: 'Al-Jathiyah', ayahs: 37, type: 'Meccan' },
      { number: 46, name: 'Al-Ahqaf', ayahs: 35, type: 'Meccan' },
      { number: 47, name: 'Muhammad', ayahs: 38, type: 'Medinan' },
      { number: 48, name: 'Al-Fath', ayahs: 29, type: 'Medinan' },
      { number: 49, name: 'Al-Hujurat', ayahs: 18, type: 'Medinan' },
      { number: 50, name: 'Qaf', ayahs: 45, type: 'Meccan' },
      { number: 51, name: 'Adh-Dhariyat', ayahs: 60, type: 'Meccan' },
      { number: 52, name: 'At-Tur', ayahs: 49, type: 'Meccan' },
      { number: 53, name: 'An-Najm', ayahs: 62, type: 'Meccan' },
      { number: 54, name: 'Al-Qamar', ayahs: 55, type: 'Meccan' },
      { number: 55, name: 'Ar-Rahman', ayahs: 78, type: 'Medinan' },
      { number: 56, name: 'Al-Waqi\'ah', ayahs: 96, type: 'Meccan' },
      { number: 57, name: 'Al-Hadid', ayahs: 29, type: 'Medinan' },
      { number: 58, name: 'Al-Mujadila', ayahs: 22, type: 'Medinan' },
      { number: 59, name: 'Al-Hashr', ayahs: 24, type: 'Medinan' },
      { number: 60, name: 'Al-Mumtahanah', ayahs: 13, type: 'Medinan' },
      { number: 61, name: 'As-Saf', ayahs: 14, type: 'Medinan' },
      { number: 62, name: 'Al-Jumu\'ah', ayahs: 11, type: 'Medinan' },
      { number: 63, name: 'Al-Munafiqun', ayahs: 11, type: 'Medinan' },
      { number: 64, name: 'At-Taghabun', ayahs: 18, type: 'Medinan' },
      { number: 65, name: 'At-Talaq', ayahs: 12, type: 'Medinan' },
      { number: 66, name: 'At-Tahrim', ayahs: 12, type: 'Medinan' },
      { number: 67, name: 'Al-Mulk', ayahs: 30, type: 'Meccan' },
      { number: 68, name: 'Al-Qalam', ayahs: 52, type: 'Meccan' },
      { number: 69, name: 'Al-Haqqah', ayahs: 52, type: 'Meccan' },
      { number: 70, name: 'Al-Ma\'arij', ayahs: 44, type: 'Meccan' },
      { number: 71, name: 'Nuh', ayahs: 28, type: 'Meccan' },
      { number: 72, name: 'Al-Jinn', ayahs: 28, type: 'Meccan' },
      { number: 73, name: 'Al-Muzzammil', ayahs: 20, type: 'Meccan' },
      { number: 74, name: 'Al-Muddaththir', ayahs: 56, type: 'Meccan' },
      { number: 75, name: 'Al-Qiyamah', ayahs: 40, type: 'Meccan' },
      { number: 76, name: 'Al-Insan', ayahs: 31, type: 'Medinan' },
      { number: 77, name: 'Al-Mursalat', ayahs: 50, type: 'Meccan' },
      { number: 78, name: 'An-Naba', ayahs: 40, type: 'Meccan' },
      { number: 79, name: 'An-Nazi\'at', ayahs: 46, type: 'Meccan' },
      { number: 80, name: '\'Abasa', ayahs: 42, type: 'Meccan' },
      { number: 81, name: 'At-Takwir', ayahs: 29, type: 'Meccan' },
      { number: 82, name: 'Al-Infitar', ayahs: 19, type: 'Meccan' },
      { number: 83, name: 'Al-Mutaffifin', ayahs: 36, type: 'Meccan' },
      { number: 84, name: 'Al-Inshiqaq', ayahs: 25, type: 'Meccan' },
      { number: 85, name: 'Al-Buruj', ayahs: 22, type: 'Meccan' },
      { number: 86, name: 'At-Tariq', ayahs: 17, type: 'Meccan' },
      { number: 87, name: 'Al-A\'la', ayahs: 19, type: 'Meccan' },
      { number: 88, name: 'Al-Ghashiyah', ayahs: 26, type: 'Meccan' },
      { number: 89, name: 'Al-Fajr', ayahs: 30, type: 'Meccan' },
      { number: 90, name: 'Al-Balad', ayahs: 20, type: 'Meccan' },
      { number: 91, name: 'Ash-Shams', ayahs: 15, type: 'Meccan' },
      { number: 92, name: 'Al-Layl', ayahs: 21, type: 'Meccan' },
      { number: 93, name: 'Ad-Duhaa', ayahs: 11, type: 'Meccan' },
      { number: 94, name: 'Ash-Sharh', ayahs: 8, type: 'Meccan' },
      { number: 95, name: 'At-Tin', ayahs: 8, type: 'Meccan' },
      { number: 96, name: 'Al-\'Alaq', ayahs: 19, type: 'Meccan' },
      { number: 97, name: 'Al-Qadr', ayahs: 5, type: 'Meccan' },
      { number: 98, name: 'Al-Bayyinah', ayahs: 8, type: 'Medinan' },
      { number: 99, name: 'Az-Zalzalah', ayahs: 8, type: 'Medinan' },
      { number: 100, name: 'Al-\'Adiyat', ayahs: 11, type: 'Meccan' },
      { number: 101, name: 'Al-Qari\'ah', ayahs: 11, type: 'Meccan' },
      { number: 102, name: 'At-Takathur', ayahs: 8, type: 'Meccan' },
      { number: 103, name: 'Al-\'Asr', ayahs: 3, type: 'Meccan' },
      { number: 104, name: 'Al-Humazah', ayahs: 9, type: 'Meccan' },
      { number: 105, name: 'Al-Fil', ayahs: 5, type: 'Meccan' },
      { number: 106, name: 'Quraysh', ayahs: 4, type: 'Meccan' },
      { number: 107, name: 'Al-Ma\'un', ayahs: 7, type: 'Meccan' },
      { number: 108, name: 'Al-Kawthar', ayahs: 3, type: 'Meccan' },
      { number: 109, name: 'Al-Kafirun', ayahs: 6, type: 'Meccan' },
      { number: 110, name: 'An-Nasr', ayahs: 3, type: 'Medinan' },
      { number: 111, name: 'Al-Masad', ayahs: 5, type: 'Meccan' },
      { number: 112, name: 'Al-Ikhlas', ayahs: 4, type: 'Meccan' },
      { number: 113, name: 'Al-Falaq', ayahs: 5, type: 'Meccan' },
      { number: 114, name: 'An-Nas', ayahs: 6, type: 'Meccan' },
    ] as const;
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 describes a read-only operation but doesn't disclose behavioral traits like error handling (e.g., for invalid surah numbers), response format, or performance characteristics. The description is minimal and lacks context about what happens during execution.

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, well-structured sentence that efficiently conveys the tool's purpose and key details. It's front-loaded with the main action and includes specific examples of information retrieved, with zero wasted words.

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 low complexity (single parameter, no annotations, no output schema), the description is adequate but minimal. It covers the basic purpose but lacks details on output structure or error cases, which would be helpful for an agent to use it correctly without trial and error.

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%, with the parameter 'surah' fully documented in the schema (type, range, description). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 for high schema coverage.

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 'information about a Surah (chapter)', specifying what information is included: name, number of verses, and revelation type. It distinguishes from siblings like 'get_full_surah' (which likely provides more detailed content) by focusing on metadata, but doesn't explicitly name alternatives.

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 basic surah metadata is needed, but doesn't explicitly state when to use this tool versus alternatives like 'list_surahs' (for listing all surahs) or 'get_full_surah' (for detailed content). No exclusions or prerequisites are mentioned.

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