Skip to main content
Glama

QuickBooks Online MCP Server

by heyibad
create-account.tool.ts1.65 kB
import { createQuickbooksAccount } from "../handlers/create-quickbooks-account.handler.js"; import { ToolDefinition } from "../types/tool-definition.js"; import { z } from "zod"; const toolName = "create_account"; const toolTitle = "Create Account"; const toolDescription = "Create a chart‑of‑accounts entry in QuickBooks Online."; const inputSchema = { name: z.string().min(1), type: z.string().min(1), sub_type: z.string().optional(), description: z.string().optional(), }; 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"), }; const toolHandler = async (params: z.infer<z.ZodObject<typeof inputSchema>>) => { const response = await createQuickbooksAccount(params); if (response.isError) { const output = { success: false, error: response.error || "Unknown error occurred", }; return { content: [ { type: "text" as const, text: JSON.stringify(output, null, 2), }, ], structuredContent: output, isError: true, }; } return { content: [ { type: "text" as const, text: `Account created successfully:` }, { type: "text" as const, text: JSON.stringify(response.result, null, 2) }, ], }; }; export const CreateAccountTool: 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