Skip to main content
Glama
standardbeagle

Harvest MCP Server

harvest_list_time_entries

Retrieve time entries from Harvest with filters for user, project, date range, and pagination to track work hours and manage time data.

Instructions

List time entries with optional filters. Use about {"tool": "harvest_list_time_entries"} for detailed usage examples.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idNoFilter by user ID
project_idNoFilter by project ID
fromNoStart date (YYYY-MM-DD)
toNoEnd date (YYYY-MM-DD)
pageNoPage number
per_pageNoResults per page (max 100)

Implementation Reference

  • Core handler function that builds query parameters from input options and makes an authenticated GET request to the Harvest API /time_entries endpoint to list time entries with optional filters.
    async getTimeEntries(options?: any) { const queryString = this.buildQueryString(options); return this.makeRequest(`/time_entries${queryString}`); }
  • Tool definition including name, description, and input schema for validation and MCP tool listing.
    { name: 'harvest_list_time_entries', description: 'List time entries with optional filters. Use about {"tool": "harvest_list_time_entries"} for detailed usage examples.', inputSchema: { type: 'object', properties: { user_id: { type: 'string', description: 'Filter by user ID' }, project_id: { type: 'string', description: 'Filter by project ID' }, from: { type: 'string', description: 'Start date (YYYY-MM-DD)' }, to: { type: 'string', description: 'End date (YYYY-MM-DD)' }, page: { type: 'number', description: 'Page number' }, per_page: { type: 'number', description: 'Results per page (max 100)' } } } },
  • src/index.ts:83-92 (registration)
    MCP CallToolRequest dispatch case that invokes the handler and formats the response as MCP content.
    case 'harvest_list_time_entries': const timeEntries = await harvestClient.getTimeEntries(typedArgs); return { content: [ { type: 'text', text: JSON.stringify(timeEntries, null, 2), }, ], };
  • src/index.ts:69-73 (registration)
    Registers the tools list including harvest_list_time_entries schema for MCP ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: tools, }; });
  • Helper function to construct URL query string from filter parameters used by getTimeEntries.
    private buildQueryString(params?: Record<string, any>): string { if (!params) return ''; const queryParams = new URLSearchParams(); Object.entries(params).forEach(([key, value]) => { if (value !== undefined && value !== null) { queryParams.append(key, String(value)); } }); const queryString = queryParams.toString(); return queryString ? `?${queryString}` : ''; } // Time Entries async getTimeEntries(options?: any) { const queryString = this.buildQueryString(options); return this.makeRequest(`/time_entries${queryString}`); }

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

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