Skip to main content
Glama

delete_estimate

Permanently delete an estimate from Harvest time tracking. This action cannot be undone. Provide the estimate ID to remove it from the system.

Instructions

Delete an estimate permanently. This action cannot be undone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
estimate_idYesThe ID of the estimate to delete

Implementation Reference

  • The DeleteEstimateHandler class implements the logic for deleting an estimate. It validates the estimate_id input and calls the harvestClient to perform the deletion.
    class DeleteEstimateHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const inputSchema = z.object({ estimate_id: z.number().int().positive() });
          const { estimate_id } = validateInput(inputSchema, args, 'delete estimate');
          
          logger.info('Deleting estimate via Harvest API', { estimateId: estimate_id });
          await this.config.harvestClient.deleteEstimate(estimate_id);
          
          return {
            content: [{ type: 'text', text: JSON.stringify({ message: `Estimate ${estimate_id} deleted successfully` }, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'delete_estimate');
        }
      }
    }
  • The delete_estimate tool is registered in registerEstimateTools within src/tools/estimates.ts, associating the name 'delete_estimate' with the DeleteEstimateHandler instance.
    {
      tool: {
        name: 'delete_estimate',
        description: 'Delete an estimate permanently. This action cannot be undone.',
        inputSchema: {
          type: 'object',
          properties: {
            estimate_id: { type: 'number', description: 'The ID of the estimate to delete' },
          },
          required: ['estimate_id'],
          additionalProperties: false,
        },
      },
      handler: new DeleteEstimateHandler(config),
    },

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