Skip to main content
Glama

search_quran_by_topic

Find Quran verses by topic to explore Islamic teachings on subjects like prayer, charity, faith, mercy, and knowledge. Use predefined topics to quickly locate relevant verses with translations.

Instructions

Search the Quran by common Islamic topics. This tool uses predefined topic mappings to find relevant verses. Topics include: prayer, patience, charity, faith, paradise, hell, prophet, allah, mercy, justice, knowledge, family, death, creation, guidance. The AI understands these topics and can suggest them to users.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYesTopic to search for. Common topics: prayer, patience, charity, faith, paradise, hell, prophet, allah, mercy, justice, knowledge, family, death, creation, guidance
translationNoTranslation to search in (default: en.sahih)en.sahih
max_resultsNoMaximum number of results to return (default: 10)

Implementation Reference

  • The main handler function that implements the tool logic by mapping predefined topics to search keywords and delegating to the general searchQuran function.
    export async function searchQuranByTopic( topic: string, translationSlug: string = 'en.sahih', maxResults: number = 10 ): Promise<SearchResult[]> { // Map common topics to search terms const topicKeywords: Record<string, string> = { 'prayer': 'prayer salah worship prostrate bow', 'patience': 'patient patience persevere steadfast', 'charity': 'charity alms poor needy spend', 'faith': 'believe faith believer trust', 'paradise': 'paradise garden heaven jannah', 'hell': 'hell fire punishment hellfire', 'prophet': 'prophet messenger muhammad', 'allah': 'allah god lord', 'mercy': 'mercy merciful compassion forgive', 'justice': 'justice just fair equity', 'knowledge': 'knowledge learn wisdom understand', 'family': 'family parents children wife husband', 'death': 'death die hereafter resurrection', 'creation': 'creation create heavens earth', 'guidance': 'guidance guide straight path', }; const searchQuery = topicKeywords[topic.toLowerCase()] || topic; return searchQuran(searchQuery, translationSlug, maxResults); }
  • MCP tool schema definition specifying the input parameters, description, and validation rules.
    { name: 'search_quran_by_topic', description: 'Search the Quran by common Islamic topics. This tool uses predefined topic mappings to find relevant verses. Topics include: prayer, patience, charity, faith, paradise, hell, prophet, allah, mercy, justice, knowledge, family, death, creation, guidance. The AI understands these topics and can suggest them to users.', inputSchema: { type: 'object', properties: { topic: { type: 'string', description: 'Topic to search for. Common topics: prayer, patience, charity, faith, paradise, hell, prophet, allah, mercy, justice, knowledge, family, death, creation, guidance', }, translation: { type: 'string', description: 'Translation to search in (default: en.sahih)', default: 'en.sahih', }, max_results: { type: 'number', description: 'Maximum number of results to return (default: 10)', default: 10, }, }, required: ['topic'], }, },
  • Runtime dispatch/registration in the tool executor switch statement that calls the handler function with parsed arguments.
    case 'search_quran_by_topic': { const { topic, translation = 'en.sahih', max_results = 10 } = args; result = await searchQuranByTopic(topic, translation, max_results); break;
  • Import statement that brings the handler into the executor scope.
    searchQuranByTopic

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