Skip to main content
Glama
hrishi0102

Payman AI MCP Server

by hrishi0102

get-balance

Check account balances on the Payman AI MCP Server using natural language prompts. Simplify financial tracking and manage your payments efficiently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get-balance' tool. It fetches the current balance in TSD currency from the Payman API using the provided API key, handles authentication errors, HTTP errors, and network issues, returning formatted text content or error messages.
    server.tool("get-balance", {}, async () => { if (!paymanApiKey) { return { content: [ { type: "text", text: "API key has not been set. Please use the set-api-key tool first.", }, ], isError: true, }; } try { const response = await fetch( "https://agent.payman.ai/api/balances/currencies/TSD", { method: "GET", headers: { "x-payman-api-secret": paymanApiKey, "content-type": "application/json", }, } ); // Handle the response if (!response.ok) { let errorData; try { errorData = await response.json(); } catch (e) { errorData = await response.text(); } return { content: [ { type: "text", text: `Error fetching balance (Status ${ response.status }): ${JSON.stringify(errorData)}`, }, ], isError: true, }; } const data = await response.json(); return { content: [ { type: "text", text: `Current Balance: ${data}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Failed to get balance: ${ error instanceof Error ? error.message : String(error) }`, }, ], isError: true, }; } });
  • Registration of the 'get-balance' tool with empty input schema on the MCP server.
    server.tool("get-balance", {}, async () => {
  • Empty input schema for the 'get-balance' tool, indicating no input parameters are required.
    server.tool("get-balance", {}, async () => {

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/hrishi0102/payman_mcp'

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