Skip to main content
Glama
djalal

quran-mcp-server

by djalal

info

Retrieve detailed chapter information from the Quran, including metadata and content, by specifying chapter ID and language. Designed for integration with the Quran.com corpus API.

Instructions

Get Chapter Info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chapter_idNoChapter ID (1-114)
languageYesParameter language (e.g., 'en', 'ar', 'fr-CA')

Implementation Reference

  • Executes the logic for the 'info' tool: validates arguments with chapterInfoSchema, fetches chapter info via service, logs, and returns JSON-formatted text content or error.
    export async function handleChapterInfo(args: any) {
      try {
        // Validate arguments
        const validatedArgs = chapterInfoSchema.parse(args);
        
        // Call the service
        const result = await chaptersService.getChapterInfo(validatedArgs);
        
        // Log the response in verbose mode
        verboseLog('response', {
          tool: 'info',
          result
        });
        
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2)
            }
          ]
        };
      } catch (error) {
        verboseLog('error', {
          tool: 'info',
          error: error instanceof Error ? error.message : String(error)
        });
        
        if (error instanceof z.ZodError) {
          return {
            content: [{ 
              type: "text", 
              text: `Validation error: ${error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`
            }],
            isError: true,
          };
        }
        
        return {
          content: [{ 
            type: "text", 
            text: `Error: ${error instanceof Error ? error.message : "Unknown error"}`
          }],
          isError: true,
        };
      }
    }
  • Input schema (Zod) for the 'info' tool, defining 'language' (required string) and 'chapter_id' (optional number 1-114).
    export const chapterInfoSchema = z.object({
      language: z.string()
        .trim()
        .min(2, "Language code must be at least 2 characters")
        .max(10, "Language code must not exceed 10 characters")
        .regex(/^[a-zA-Z-]+$/, "Language code must contain only letters and hyphens")
        .describe("Parameter language (e.g., 'en', 'ar', 'fr-CA')"),
      chapter_id: z.union([
        z.string()
          .trim()
          .regex(/^\d+$/, "Chapter ID must be a positive integer")
          .transform(Number),
        z.number()
          .int("Chapter ID must be an integer")
          .positive("Chapter ID must be positive")
      ])
        .optional()
        .describe("Chapter ID (1-114)"),
    });
  • src/server.ts:136-139 (registration)
    Tool registration in the 'listTools' handler, defining name 'info', description, and input schema for the MCP protocol.
      name: ApiTools.info,
      description: "Get Chapter Info",
      inputSchema: zodToJsonSchema(chaptersSchemas.chapterInfo),
    },
  • src/server.ts:261-262 (registration)
    Routing in the 'callTool' switch statement that maps 'info' tool calls to the handleChapterInfo handler.
    case ApiTools.info:
      return await handleChapterInfo(request.params.arguments);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get Chapter Info' implies a read-only operation, but it doesn't specify whether authentication is required, rate limits apply, what format the information is returned in, or any error conditions. The description adds minimal behavioral context beyond the basic action.

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 at just three words, with no wasted language. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place in this minimal formulation.

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 the lack of annotations and output schema, the description is insufficiently complete. For a tool with 2 parameters (one required) and no structured output documentation, 'Get Chapter Info' doesn't explain what information is returned, how results are formatted, or any behavioral constraints. The description leaves too many contextual gaps for effective tool selection.

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 both parameters ('chapter_id' and 'language') well-documented in the schema. The description adds no additional parameter information beyond what's already in the schema, so it meets the baseline for high schema coverage without compensating value.

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

Purpose3/5

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

The description 'Get Chapter Info' clearly states the action (Get) and resource (Chapter Info), but it's vague about what specific information is retrieved. It doesn't distinguish this tool from similar siblings like 'GET-chapter' or 'chapter-reciters' that might also provide chapter-related information.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools related to chapters (e.g., 'GET-chapter', 'chapter-reciters', 'list-chapters'), there's no indication of what makes this tool unique or when it should be preferred over others.

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

Related 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/djalal/quran-mcp-server'

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