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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/bayarcash-client.ts:219-226 (handler)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); } }
- src/index.ts:314-323 (handler)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: {} } },
- src/smithery.ts:125-136 (registration)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) }] }; } );
- src/smithery.ts:167-188 (helper)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 {