Skip to main content
Glama

list_estimates

Retrieve and filter estimates by client, state, and date ranges from Harvest time tracking. Returns paginated results with detailed estimate information.

Instructions

Retrieve estimates with filtering by client, state, and date ranges. Returns paginated results with estimate details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
client_idNoFilter by client ID
stateNoFilter by estimate state
fromNoStart date for date range filter (YYYY-MM-DD)
toNoEnd date for date range filter (YYYY-MM-DD)
updated_sinceNoFilter by estimates updated since this timestamp
pageNoPage number for pagination
per_pageNoNumber of estimates per page (max 2000)

Implementation Reference

  • The class implementation of the ListEstimatesHandler which processes the tool request.
    class ListEstimatesHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(EstimateQuerySchema, args, 'estimate query');
          logger.info('Listing estimates from Harvest API');
          const estimates = await this.config.harvestClient.getEstimates(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(estimates, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'list_estimates');
        }
      }
    }
  • The registration of 'list_estimates' within the registerEstimateTools function.
    {
      tool: {
        name: 'list_estimates',
        description: 'Retrieve estimates with filtering by client, state, and date ranges. Returns paginated results with estimate details.',
        inputSchema: {
          type: 'object',
          properties: {
            client_id: { type: 'number', description: 'Filter by client ID' },
            state: { type: 'string', enum: ['draft', 'sent', 'accepted', 'declined'], description: 'Filter by estimate state' },
            from: { type: 'string', format: 'date', description: 'Start date for date range filter (YYYY-MM-DD)' },
            to: { type: 'string', format: 'date', description: 'End date for date range filter (YYYY-MM-DD)' },
            updated_since: { type: 'string', format: 'date-time', description: 'Filter by estimates updated since this timestamp' },
            page: { type: 'number', minimum: 1, description: 'Page number for pagination' },
            per_page: { type: 'number', minimum: 1, maximum: 2000, description: 'Number of estimates per page (max 2000)' },
          },
          additionalProperties: false,
        },
      },
      handler: new ListEstimatesHandler(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