Skip to main content
Glama
djalal

quran-mcp-server

by djalal

translation-info

Retrieve detailed information about a specific Quran translation by providing its ID. Integrates with quran-mcp-server to access Quran.com corpus data via REST API v4.

Instructions

Get information of a specific translation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
translation_idYesTranslation id

Implementation Reference

  • The primary handler function for executing the 'translation-info' tool. It validates the input arguments using the translationInfoSchema, calls the translationsService to retrieve the translation information, logs the response or error, and returns the result as a formatted text content block.
     * Handler for the translation-info tool
     */
    export async function handleTranslationInfo(args: any) {
      try {
        // Validate arguments
        const validatedArgs = translationInfoSchema.parse(args);
        
        // Call the service
        const result = await translationsService.getTranslationInfo(validatedArgs);
        
        // Log the response in verbose mode
        verboseLog('response', {
          tool: 'translation-info',
          result
        });
        
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2)
            }
          ]
        };
      } catch (error) {
        verboseLog('error', {
          tool: 'translation-info',
          error: error instanceof Error ? error.message : String(error)
        });
        
        // Use the standardized error response utility
        const { createErrorResponse } = require('../utils/error-handler');
        return createErrorResponse(error, 'translation-info');
      }
  • Zod schema used for input validation of the 'translation-info' tool, requiring a 'translation_id' string parameter.
     * Schema for translation-info
     */
    export const translationInfoSchema = z.object({
      translation_id: z.string().describe("Translation id"),
    });
  • src/server.ts:198-201 (registration)
    Registration of the 'translation-info' tool in the MCP server's tool list, specifying name, description, and input schema.
      name: ApiTools.translation_info,
      description: "Get information of a specific translation",
      inputSchema: zodToJsonSchema(translationsSchemas.translationInfo),
    },
  • src/server.ts:290-292 (registration)
    Dispatch logic in the tool call handler that routes 'translation-info' calls to the handleTranslationInfo function.
      return await handleTranslations(request.params.arguments);
    case ApiTools.translation_info:
      return await handleTranslationInfo(request.params.arguments);
  • Service class method that performs the actual API request to Quran.com for translation info based on translation_id, handles errors, and returns structured response.
    async getTranslationInfo(params: z.infer<typeof translationInfoSchema>): Promise<TranslationInfoResponse> {
      try {
        // Validate parameters
        const validatedParams = translationInfoSchema.parse(params);
        
        const url = `${API_BASE_URL}/resources/translations/${validatedParams.translation_id}/info`;
        
        // Make request to Quran.com API
        const data = await makeApiRequest(url);
        
        return {
          success: true,
          message: "translation-info executed successfully",
          data
        };
      } catch (error) {
        verboseLog('error', {
          method: 'getTranslationInfo',
          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 the full burden of behavioral disclosure. It states 'Get information' which implies a read-only operation, but doesn't specify what information is returned (e.g., metadata, status), potential errors, or any constraints like rate limits or authentication needs. This leaves significant gaps for a tool with no annotation coverage.

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, efficient sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place by conveying essential purpose without redundancy.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what 'information' includes (e.g., fields returned), error conditions, or behavioral traits. For a tool that likely returns structured data about translations, this lack of detail makes it inadequate for full contextual understanding.

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?

The input schema has 100% description coverage, with the parameter 'translation_id' documented as 'Translation id'. The description adds no additional meaning beyond this, such as format examples or context about what a translation_id represents. Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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 of a specific translation', making the purpose understandable. It distinguishes from siblings like 'translations' (likely listing translations) by focusing on a specific translation, though it doesn't explicitly contrast with 'tafsir-info' or other info tools.

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. It doesn't mention prerequisites (e.g., needing a translation_id), exclusions, or comparisons to sibling tools like 'translations' or 'tafsir-info', leaving usage context implied rather than explicit.

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