Skip to main content
Glama

get_payment_channels

Retrieve available Malaysian payment channels for processing transactions through the Bayarcash payment gateway API.

Instructions

Get list of available payment channels

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portal_keyNoOptional portal key to filter channels

Implementation Reference

  • The handler function for the 'get_payment_channels' tool. Validates the input arguments using portalKeySchema and calls bayarcash.getChannels(portal_key) to retrieve the list of payment channels.
    case 'get_payment_channels': {
      // Validate input
      const validation = validateInput(portalKeySchema, args);
      if (!validation.success) {
        throw new McpError(ErrorCode.InvalidParams, `Validation error: ${validation.error}`);
      }
    
      const result = await bayarcash.getChannels(validation.data.portal_key);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • src/index.ts:189-201 (registration)
    Registration of the 'get_payment_channels' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'get_payment_channels',
      description: 'Get list of available payment channels',
      inputSchema: {
        type: 'object',
        properties: {
          portal_key: {
            type: 'string',
            description: 'Optional portal key to filter channels'
          }
        }
      }
    },
  • Zod schema used for validating the input to get_payment_channels tool (portal_key optional string).
    export const portalKeySchema = z.object({
      portal_key: z.string().optional()
    });
  • The BayarcashClient method getChannels that provides the actual implementation, returning a hardcoded list of payment channels (ignores portalKey). Called by the tool handler.
    async getChannels(portalKey?: string): Promise<PaymentChannel[]> {
      // Return hardcoded payment channels
      return [
        { id: '1', name: 'FPX', code: 'fpx' },
        { id: '2', name: 'DuitNow', code: 'duitnow' },
        { id: '3', name: 'Boost', code: 'boost' },
        { id: '4', name: 'GrabPay', code: 'grabpay' },
        { id: '5', name: 'Touch n Go', code: 'tng' },
        { id: '6', name: 'ShopeePay', code: 'shopeepay' },
        { id: '7', name: 'SPayLater', code: 'spaylater' },
        { id: '8', name: 'Boost PayFlex', code: 'boostpayflex' },
        { id: '9', name: 'QRIS', code: 'qris' },
        { id: '10', name: 'NETS', code: 'nets' }
      ];
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states this is a read operation ('Get list'), implying non-destructive behavior, but doesn't cover rate limits, authentication needs, error conditions, or what 'available' means in practice (e.g., active vs. configured channels).

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 appropriately sized for a simple list-retrieval tool and front-loads the core purpose effectively.

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?

For a simple tool with one optional parameter and no output schema, the description is minimally adequate but lacks context about the payment system, what channels are (e.g., credit cards, bank transfers), or how results are structured. Without annotations, more behavioral detail would improve completeness.

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 description mentions 'Optional portal key to filter channels', which aligns with the schema's 100% coverage for the single parameter. However, it doesn't add meaning beyond the schema's description of 'portal_key', such as explaining what a portal represents or how filtering affects results.

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 resource ('list of available payment channels'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_fpx_banks' or 'get_portals' which also retrieve lists of financial entities, leaving some ambiguity about scope.

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 'get_fpx_banks' or 'get_portals'. It mentions an optional filter parameter but doesn't explain when filtering is appropriate or what the unfiltered list includes.

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

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/khairulimran-97/bayarcash-mcp-server'

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