create_client
Create a new client for project management and billing in Harvest. Configure client details including name, address, and currency to organize time tracking and invoicing.
Instructions
Create a new client for project management and billing. Requires client name and supports address and currency configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Client name (required) | |
| is_active | No | Whether the client is active | |
| address | No | Client address | |
| currency | No | 3-letter ISO currency code (e.g., USD, EUR) |
Implementation Reference
- src/tools/clients.ts:58-74 (handler)Implementation of the CreateClientHandler class which executes the logic for the create_client tool.
class CreateClientHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const validatedArgs = validateInput(CreateClientSchema, args, 'create client'); logger.info('Creating client via Harvest API'); const client = await this.config.harvestClient.createClient(validatedArgs); return { content: [{ type: 'text', text: JSON.stringify(client, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'create_client'); } } } - src/tools/clients.ts:148-165 (registration)Registration of the 'create_client' tool within the registerClientTools function.
{ tool: { name: 'create_client', description: 'Create a new client for project management and billing. Requires client name and supports address and currency configuration.', inputSchema: { type: 'object', properties: { name: { type: 'string', minLength: 1, description: 'Client name (required)' }, is_active: { type: 'boolean', description: 'Whether the client is active' }, address: { type: 'string', description: 'Client address' }, currency: { type: 'string', minLength: 3, maxLength: 3, description: '3-letter ISO currency code (e.g., USD, EUR)' }, }, required: ['name'], additionalProperties: false, }, }, handler: new CreateClientHandler(config), },