Skip to main content
Glama

create_estimate

Create client estimates with custom pricing, taxes, and discounts for accurate project cost projections.

Instructions

Create a new estimate for a client with optional line items and terms. Supports custom pricing, taxes, and discounts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
client_idYesThe client ID to create the estimate for (required)
subjectNoEstimate subject line
notesNoEstimate notes or description
currencyNo3-letter ISO currency code (e.g., USD, EUR)
issue_dateNoEstimate issue date (YYYY-MM-DD)
taxNoTax percentage (0-100)
tax2NoSecond tax percentage (0-100)
discountNoDiscount percentage (0-100)
purchase_orderNoClient purchase order number

Implementation Reference

  • Handler class for executing the create_estimate tool.
    class CreateEstimateHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(CreateEstimateSchema, args, 'create estimate');
          logger.info('Creating estimate via Harvest API');
          const estimate = await this.config.harvestClient.createEstimate(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(estimate, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'create_estimate');
        }
      }
    }
  • Tool definition and registration for create_estimate.
      tool: {
        name: 'create_estimate',
        description: 'Create a new estimate for a client with optional line items and terms. Supports custom pricing, taxes, and discounts.',
        inputSchema: {
          type: 'object',
          properties: {
            client_id: { type: 'number', description: 'The client ID to create the estimate for (required)' },
            subject: { type: 'string', description: 'Estimate subject line' },
            notes: { type: 'string', description: 'Estimate notes or description' },
            currency: { type: 'string', minLength: 3, maxLength: 3, description: '3-letter ISO currency code (e.g., USD, EUR)' },
            issue_date: { type: 'string', format: 'date', description: 'Estimate issue date (YYYY-MM-DD)' },
            tax: { type: 'number', minimum: 0, maximum: 100, description: 'Tax percentage (0-100)' },
            tax2: { type: 'number', minimum: 0, maximum: 100, description: 'Second tax percentage (0-100)' },
            discount: { type: 'number', minimum: 0, maximum: 100, description: 'Discount percentage (0-100)' },
            purchase_order: { type: 'string', description: 'Client purchase order number' },
          },
          required: ['client_id'],
          additionalProperties: false,
        },
      },
      handler: new CreateEstimateHandler(config),
    },
  • Zod schema definition for input validation of create_estimate.
    export const CreateEstimateSchema = z.object({
      client_id: z.number().int().positive(),
      subject: z.string().optional(),
      notes: z.string().optional(),
      currency: z.string().length(3).optional().default('USD'),
      issue_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'Date must be in YYYY-MM-DD format').optional(),
      tax: z.number().min(0).max(100).optional(),
      tax2: z.number().min(0).max(100).optional(),
      discount: z.number().min(0).max(100).optional(),
      purchase_order: z.string().optional(),

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/ianaleck/harvest-mcp-server'

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