Skip to main content
Glama
djalal

quran-mcp-server

by djalal

juzs

Retrieve a complete list of all juzs from the Quran using the Quran.com REST API v4 integration. Simplify access to Quranic divisions for study or reference purposes.

Instructions

Get list of all juzs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function for the 'juzs' tool. Validates input using juzsSchema, calls juzsService.getJuzs, formats response as MCP content or error.
    export async function handleJuzs(args: any) {
      try {
        // Validate arguments
        const validatedArgs = juzsSchema.parse(args);
        
        // Call the service
        const result = await juzsService.getJuzs(validatedArgs);
        
        // Log the response in verbose mode
        verboseLog('response', {
          tool: 'juzs',
          result
        });
        
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2)
            }
          ]
        };
      } catch (error) {
        verboseLog('error', {
          tool: 'juzs',
          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,
        };
      }
  • Zod input schema for the juzs tool, defined as an empty object indicating no required parameters.
    export const juzsSchema = z.object({});
  • src/server.ts:178-183 (registration)
    Tool registration in the listTools response, defining name, description, input schema, and examples for 'juzs'.
    {
      name: ApiTools.juzs,
      description: "Get list of all juzs",
      inputSchema: zodToJsonSchema(juzsSchemas.juzs),
      examples: toolExamples['juzs'],
    },
  • src/server.ts:280-282 (registration)
    Dispatch/handling of 'juzs' tool call in the CallToolRequestSchema switch statement, invoking handleJuzs.
    // Juzs-related tools
    case ApiTools.juzs:
      return await handleJuzs(request.params.arguments);
  • Service method that fetches juzs data from Quran.com API endpoint '/juzs', handles validation and errors, called by the handler.
    async getJuzs(params: z.infer<typeof juzsSchema>): Promise<JuzsResponse> {
      try {
        // Validate parameters
        const validatedParams = juzsSchema.parse(params);
        
        const url = `${API_BASE_URL}/juzs`;
        
        // Make request to Quran.com API
        const data = await makeApiRequest(url, {});
        
        return {
          success: true,
          message: "juzs executed successfully",
          data
        };
      } catch (error) {
        verboseLog('error', {
          method: 'getJuzs',
          error: error instanceof Error ? error.message : String(error)
        });
        
        if (error instanceof z.ZodError) {
          throw new ApiError(`Validation error: ${error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`, 400);
        }
        
        // Re-throw other errors
        throw error;
      }
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 states 'Get list of all juzs' which implies a read-only operation, but doesn't disclose any behavioral traits such as rate limits, authentication needs, pagination, or response format. This leaves significant gaps for an agent to understand how to use it effectively.

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, clear sentence with no wasted words. It's front-loaded with the core purpose and appropriately sized for a tool with no parameters, making it highly efficient and easy to parse.

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 simplicity (0 parameters, no output schema), the description is minimally adequate but lacks context about what a 'juz' is or how the list is structured. Without annotations or output schema, more detail on the return format would help, though the low complexity keeps it from being severely incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description doesn't need to add parameter information, and it correctly implies no parameters are required, earning a baseline high score for this simple case.

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 tool's purpose with a specific verb ('Get') and resource ('list of all juzs'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'verses-by_juz_number' or 'hizb_number' tools, which prevents a perfect score.

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 sibling tools like 'verses-by_juz_number' that might retrieve verses for a specific juz, there's no indication of whether this tool is for metadata listing or when it's preferred over other juz-related 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

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