Skip to main content
Glama

QuickBooks Online MCP Server

by heyibad
update-purchase.tool.ts1.46 kB
import { updateQuickbooksPurchase } from "../handlers/update-quickbooks-purchase.handler.js"; import { ToolDefinition } from "../types/tool-definition.js"; import { z } from "zod"; // Define the tool metadata const toolName = "update_purchase"; const toolTitle = "Update Purchase"; const toolDescription = "Update a purchase in QuickBooks Online."; // Define the expected input schema for updating a purchase const inputSchema = { purchase: z.any(), }; const outputSchema = { success: z.boolean().describe("Whether the operation was successful"), data: z.any().optional().describe("The result data"), error: z.string().optional().describe("Error message if operation failed"), }; // Define the tool handler const toolHandler = async (params: z.infer<z.ZodObject<typeof inputSchema>>) => { const response = await updateQuickbooksPurchase(params.purchase); if (response.isError) { return { content: [ { type: "text" as const, text: `Error updating purchase: ${response.error}` }, ], }; } return { content: [ { type: "text" as const, text: `Purchase updated:` }, { type: "text" as const, text: JSON.stringify(response.result) }, ], }; }; export const UpdatePurchaseTool: ToolDefinition<typeof inputSchema, typeof outputSchema> = { name: toolName, title: toolTitle, description: toolDescription, inputSchema: inputSchema, outputSchema: outputSchema, handler: toolHandler, };

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/heyibad/quickbook-mcp-'

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