UNPKG

actual-mcp

Version:

Actual Budget MCP server exposing API functionality

40 lines 1.28 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) { try { if (!args.name || typeof args.name !== 'string') { return errorFromCatch('name is required and must be a string'); } const data = { name: args.name }; if (args.transferAccount) { data.transfer_acct = args.transferAccount; } const id = await createPayee(data); return successWithJson('Successfully created payee ' + id); } catch (err) { return errorFromCatch(err); } } //# sourceMappingURL=index.js.map