Skip to main content
Glama
index.ts1.26 kB
// ---------------------------- // CREATE PAYEE TOOL // ---------------------------- import { successWithJson, errorFromCatch } from '../../../utils/response.js'; import { createPayee } from '../../../actual-api.js'; export const schema = { name: 'create-payee', description: 'Create a new payee', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the payee', }, transferAccount: { type: 'string', description: 'ID of the transfer account. Should be in UUID format. Only for transfer payees.', }, }, required: ['name'], }, }; export async function handler( args: Record<string, unknown> ): Promise<ReturnType<typeof successWithJson> | ReturnType<typeof errorFromCatch>> { try { if (!args.name || typeof args.name !== 'string') { return errorFromCatch('name is required and must be a string'); } const data: Record<string, unknown> = { name: args.name }; if (args.transferAccount) { data.transfer_acct = args.transferAccount; } const id: string = await createPayee(data); return successWithJson('Successfully created payee ' + id); } catch (err) { return errorFromCatch(err); } }

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/s-stefanov/actual-mcp'

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