Skip to main content
Glama
webimpianteam

Bayarcash MCP Server

get_portals

Retrieve available payment portals to manage Malaysian payment methods like FPX, DuitNow, and e-wallets for Bayarcash transactions.

Instructions

Get list of available payment portals

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that makes the API request to Bayarcash /portals endpoint to retrieve available portals.
    async getPortals(): Promise<Portal[]> {
      try {
        const response = await this.axiosInstance.get('/portals');
        return response.data.data || response.data;
      } catch (error) {
        this.handleError(error);
      }
    }
  • MCP tool handler in the main index.ts server that dispatches the get_portals tool call by invoking bayarcash.getPortals() and formatting response.
    case 'get_portals': {
      const result = await bayarcash.getPortals();
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }
        ]
      };
  • src/index.ts:182-188 (registration)
    Tool registration and schema definition in the ListTools response for the MCP server.
      name: 'get_portals',
      description: 'Get list of available payment portals',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    },
  • Complete tool registration using Smithery server.tool(), including schema (empty), description, and inline handler.
    // Tool: Get portals
    server.tool(
      'get_portals',
      'Get list of available payment portals',
      {},
      async () => {
        const result = await bayarcash.getPortals();
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }]
        };
      }
    );
  • Helper resource that also uses getPortals() for bayarcash://portals.
    server.resource(
      'portals',
      'bayarcash://portals',
      async () => {
        const portals = await bayarcash.getPortals();
        return {
          contents: [{
            uri: 'bayarcash://portals',
            text: JSON.stringify(portals, null, 2),
            mimeType: 'application/json'
          }]
        };
      }
    );
    
    // Resource: Channels
    server.resource(
      'channels',
      'bayarcash://channels',
      async () => {
        const channels = await bayarcash.getChannels();
        return {

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

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