Skip to main content
Glama
zakblacki

Satim Payment Gateway Integration

by zakblacki

register_order

Initiate payment processing by registering a new order with the SATIM payment gateway. Specify order details, redirect URLs, and mandatory parameters to enable secure transactions via CIB/Edhahabia cards on the SATIM-ePAY platform.

Instructions

Register a new order with SATIM payment gateway

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountInDAYesOrder amount in Algerian Dinars (minimum 50 DA)
currencyNoCurrency code according to ISO 4217 (012 for DZD)012
descriptionNoOrder description
failUrlNoURL to redirect after failed payment
force_terminal_idYesTerminal ID assigned by bank (mandatory)
languageNoLanguage for the payment interface
orderNumberYesUnique order identifier in merchant's system
returnUrlYesURL to redirect after successful payment
udf1YesSATIM specific parameter (mandatory)
udf2NoAdditional parameter
udf3NoAdditional parameter
udf4NoAdditional parameter
udf5NoAdditional parameter

Implementation Reference

  • MCP CallToolRequest handler for the 'register_order' tool: checks if credentials are configured, prepares jsonParams and OrderRegistrationParams from input arguments, invokes SatimPaymentGateway.registerOrder, and returns the response as text content.
    case "register_order":
      if (!satimGateway) {
        throw new McpError(ErrorCode.InvalidRequest, "Credentials not configured. Use configure_credentials first.");
      }
    
      const jsonParams: any = {
        force_terminal_id: args.force_terminal_id as string,
        udf1: args.udf1 as string,
      };
    
      // Add optional parameters only if they exist
      if (args.udf2) jsonParams.udf2 = args.udf2 as string;
      if (args.udf3) jsonParams.udf3 = args.udf3 as string;
      if (args.udf4) jsonParams.udf4 = args.udf4 as string;
      if (args.udf5) jsonParams.udf5 = args.udf5 as string;
    
      const registrationResponse = await satimGateway.registerOrder({
        orderNumber: args.orderNumber as string,
        amount: SatimPaymentGateway.convertAmountToCentimes(args.amountInDA as number),
        currency: (args.currency as string) || "012",
        returnUrl: args.returnUrl as string,
        failUrl: args.failUrl as string,
        description: args.description as string,
        language: args.language as 'AR' | 'FR' | 'EN',
        jsonParams
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(registrationResponse, null, 2)
          }
        ]
      };
  • Core handler logic in SatimPaymentGateway class: authenticates with SATIM credentials, builds query parameters from OrderRegistrationParams, performs HTTP GET to /register.do endpoint, returns the API response.
    async registerOrder(params: OrderRegistrationParams): Promise<OrderRegistrationResponse> {
      try {
        const queryParams = new URLSearchParams({
          userName: this.credentials.userName,
          password: this.credentials.password,
          orderNumber: params.orderNumber,
          amount: params.amount.toString(),
          currency: params.currency,
          returnUrl: params.returnUrl,
          ...(params.failUrl && { failUrl: params.failUrl }),
          ...(params.description && { description: params.description }),
          ...(params.language && { language: params.language }),
          jsonParams: JSON.stringify(params.jsonParams)
        });
    
        const response = await axios.get(`${this.baseUrl}/register.do?${queryParams}`);
        return response.data;
      } catch (error) {
        throw new Error(`Order registration failed: ${error}`);
      }
    }
  • TypeScript interface defining the internal parameters structure for order registration used by SatimPaymentGateway.registerOrder.
    interface OrderRegistrationParams {
      orderNumber: string;
      amount: number; // Amount in centimes (multiply by 100)
      currency: string; // ISO 4217 (012 for DZD)
      returnUrl: string;
      failUrl?: string;
      description?: string;
      language?: 'AR' | 'FR' | 'EN';
      jsonParams: {
        force_terminal_id: string; // Mandatory
        udf1: string; // Mandatory
        udf2?: string;
        udf3?: string;
        udf4?: string;
        udf5?: string;
      };
    }
  • MCP tool registration descriptor returned by ListToolsRequestHandler, specifying name, description, and detailed inputSchema with properties and required fields.
    {
      name: "register_order",
      description: "Register a new order with SATIM payment gateway",
      inputSchema: {
        type: "object",
        properties: {
          orderNumber: {
            type: "string",
            description: "Unique order identifier in merchant's system"
          },
          amountInDA: {
            type: "number",
            description: "Order amount in Algerian Dinars (minimum 50 DA)"
          },
          currency: {
            type: "string",
            description: "Currency code according to ISO 4217 (012 for DZD)",
            default: "012"
          },
          returnUrl: {
            type: "string",
            description: "URL to redirect after successful payment"
          },
          failUrl: {
            type: "string",
            description: "URL to redirect after failed payment"
          },
          description: {
            type: "string",
            description: "Order description"
          },
          language: {
            type: "string",
            enum: ["AR", "FR", "EN"],
            description: "Language for the payment interface"
          },
          force_terminal_id: {
            type: "string",
            description: "Terminal ID assigned by bank (mandatory)"
          },
          udf1: {
            type: "string",
            description: "SATIM specific parameter (mandatory)"
          },
          udf2: { type: "string", description: "Additional parameter" },
          udf3: { type: "string", description: "Additional parameter" },
          udf4: { type: "string", description: "Additional parameter" },
          udf5: { type: "string", description: "Additional parameter" }
        },
        required: ["orderNumber", "amountInDA", "returnUrl", "force_terminal_id", "udf1"]
      }
    },
    {
  • Static helper method used in register_order to convert amount from DA to centimes before API call.
    static convertAmountToCentimes(amountInDA: number): number {
      return Math.round(amountInDA * 100);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a registration operation but doesn't clarify if this creates a persistent record, initiates a payment, returns a transaction ID, or has side effects like authentication requirements or rate limits. For a payment gateway tool with 13 parameters, this is insufficient.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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?

For a complex payment gateway tool with 13 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what happens after registration (e.g., returns a payment URL, transaction ID), error conditions, or how it fits with sibling tools like 'configure_credentials'. The agent lacks crucial context for proper usage.

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 schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description adds no additional parameter semantics beyond the tool's overall purpose. According to the rules, when schema coverage is high (>80%), the baseline score is 3 even with no param info in the description.

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 action ('register') and resource ('new order with SATIM payment gateway'), providing a specific purpose. However, it doesn't differentiate from sibling tools like 'confirm_order' or 'refund_order', which would require explicit comparison to achieve a score of 5.

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 like 'confirm_order' or 'refund_order'. It lacks context about prerequisites, such as needing configured credentials first, or when this operation is appropriate in a payment workflow.

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/zakblacki/Satim-Payment-Gateway-Integration'

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