get_client
Retrieve a specific client's complete details including contact information and billing configuration by providing the client ID.
Instructions
Retrieve a specific client by its ID. Returns complete client details including contact information and billing configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client_id | Yes | The ID of the client to retrieve |
Implementation Reference
- src/tools/clients.ts:38-56 (handler)The handler implementation for the 'get_client' tool, which validates input and calls the harvest client API.
class GetClientHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const inputSchema = z.object({ client_id: z.number().int().positive() }); const { client_id } = validateInput(inputSchema, args, 'get client'); logger.info('Fetching client from Harvest API', { clientId: client_id }); const client = await this.config.harvestClient.getClient(client_id); return { content: [{ type: 'text', text: JSON.stringify(client, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'get_client'); } } } - src/tools/clients.ts:133-147 (registration)The registration of the 'get_client' tool within the `registerClientTools` function.
{ tool: { name: 'get_client', description: 'Retrieve a specific client by its ID. Returns complete client details including contact information and billing configuration.', inputSchema: { type: 'object', properties: { client_id: { type: 'number', description: 'The ID of the client to retrieve' }, }, required: ['client_id'], additionalProperties: false, }, }, handler: new GetClientHandler(config), },