Skip to main content
Glama
standardbeagle

Harvest MCP Server

harvest_list_clients

Retrieve and filter client information from Harvest time tracking system to manage business relationships and project organization.

Instructions

List all clients with filtering options. Use about {"tool": "harvest_list_clients"} for detailed parameters and examples.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
is_activeNoFilter by active status
pageNoPage number
per_pageNoResults per page (max 100)

Implementation Reference

  • The main handler function that executes the tool logic: builds query parameters from input (is_active, page, per_page) and fetches clients list from Harvest API /clients endpoint.
    async getClients(options?: any) {
      const queryString = this.buildQueryString(options);
      return this.makeRequest(`/clients${queryString}`);
    }
  • Defines the tool's name, description, and input schema for validation (filters: is_active, page, per_page).
    {
      name: 'harvest_list_clients',
      description: 'List all clients with filtering options. Use about {"tool": "harvest_list_clients"} for detailed parameters and examples.',
      inputSchema: {
        type: 'object',
        properties: {
          is_active: { type: 'boolean', description: 'Filter by active status' },
          page: { type: 'number', description: 'Page number' },
          per_page: { type: 'number', description: 'Results per page (max 100)' }
        }
      }
    },
  • src/index.ts:69-73 (registration)
    Registers all tools (including harvest_list_clients) for the MCP listTools request, providing schemas to clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: tools,
      };
    });
  • MCP server dispatch handler case that receives tool call, passes arguments to client.getClients(), and formats JSON response.
    case 'harvest_list_clients':
      const clients = await harvestClient.getClients(typedArgs);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(clients, null, 2),
          },
        ],
      };
  • Helper function used by getClients to construct URL query string from input parameters.
    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}` : '';
    }

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