pocketsmith-mcp
Version:
MCP server for managing budgets via PocketSmith API
141 lines (140 loc) • 3.93 kB
TypeScript
/**
* @fileoverview Create a new transaction in PocketSmith
*/
import { z } from "zod";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { RequestContext } from "../../../utils/index.js";
export declare const CreateTransactionInputSchema: z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
accessToken: z.ZodOptional<z.ZodString>;
accountId: z.ZodNumber;
payee: z.ZodString;
amount: z.ZodNumber;
date: z.ZodString;
categoryId: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodNull]>>;
note: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
}, "strip", z.ZodTypeAny, {
accountId: number;
date: string;
payee: string;
amount: number;
apiKey?: string | undefined;
accessToken?: string | undefined;
categoryId?: number | null | undefined;
note?: string | null | undefined;
}, {
accountId: number;
date: string;
payee: string;
amount: number;
apiKey?: string | undefined;
accessToken?: string | undefined;
categoryId?: number | null | undefined;
note?: string | null | undefined;
}>;
export type CreateTransactionInput = z.infer<typeof CreateTransactionInputSchema>;
export declare const CreateTransactionResponseSchema: z.ZodObject<{
transaction: z.ZodObject<{
id: z.ZodNumber;
payee: z.ZodString;
amount: z.ZodNumber;
date: z.ZodString;
note: z.ZodNullable<z.ZodString>;
category: z.ZodOptional<z.ZodObject<{
id: z.ZodNumber;
title: z.ZodString;
}, "strip", z.ZodTypeAny, {
title: string;
id: number;
}, {
title: string;
id: number;
}>>;
account: z.ZodObject<{
id: z.ZodNumber;
name: z.ZodString;
}, "strip", z.ZodTypeAny, {
name: string;
id: number;
}, {
name: string;
id: number;
}>;
currency_code: z.ZodString;
type: z.ZodString;
}, "strip", z.ZodTypeAny, {
type: string;
id: number;
date: string;
currency_code: string;
payee: string;
amount: number;
note: string | null;
account: {
name: string;
id: number;
};
category?: {
title: string;
id: number;
} | undefined;
}, {
type: string;
id: number;
date: string;
currency_code: string;
payee: string;
amount: number;
note: string | null;
account: {
name: string;
id: number;
};
category?: {
title: string;
id: number;
} | undefined;
}>;
success: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
transaction: {
type: string;
id: number;
date: string;
currency_code: string;
payee: string;
amount: number;
note: string | null;
account: {
name: string;
id: number;
};
category?: {
title: string;
id: number;
} | undefined;
};
success: boolean;
}, {
transaction: {
type: string;
id: number;
date: string;
currency_code: string;
payee: string;
amount: number;
note: string | null;
account: {
name: string;
id: number;
};
category?: {
title: string;
id: number;
} | undefined;
};
success: boolean;
}>;
export type CreateTransactionResponse = z.infer<typeof CreateTransactionResponseSchema>;
export declare function createTransactionLogic(params: CreateTransactionInput, context: RequestContext): Promise<CreateTransactionResponse>;
export declare const registerCreateTransactionTool: (server: McpServer) => Promise<void>;