Skip to main content
Glama

get_estimate

Retrieve a specific estimate by ID with complete details including line items, terms, and client information from Harvest time tracking.

Instructions

Retrieve a specific estimate by ID with complete details including line items, terms, and client information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
estimate_idYesThe ID of the estimate to retrieve

Implementation Reference

  • The handler class that executes the 'get_estimate' tool logic by calling the Harvest API.
    class GetEstimateHandler 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, 'get estimate');
          
          logger.info('Fetching estimate from Harvest API', { estimateId: estimate_id });
          const estimate = await this.config.harvestClient.getEstimate(estimate_id);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(estimate, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'get_estimate');
        }
      }
    }
  • The registration block for the 'get_estimate' tool within the tool registration function.
    {
      tool: {
        name: 'get_estimate',
        description: 'Retrieve a specific estimate by ID with complete details including line items, terms, and client information.',
        inputSchema: {
          type: 'object',
          properties: {
            estimate_id: { type: 'number', description: 'The ID of the estimate to retrieve' },
          },
          required: ['estimate_id'],
          additionalProperties: false,
        },
      },
      handler: new GetEstimateHandler(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