Skip to main content
Glama

update_client

Modify client details in Harvest time tracking by updating name, active status, address, or currency for existing clients.

Instructions

Update an existing client. Can modify name, active status, address, and currency. Only provided fields will be updated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the client to update (required)
nameNoUpdate client name
is_activeNoUpdate active status
addressNoUpdate client address
currencyNoUpdate currency code

Implementation Reference

  • The UpdateClientHandler class implements the tool's execution logic by validating input and calling the Harvest API.
    class UpdateClientHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(UpdateClientSchema, args, 'update client');
          logger.info('Updating client via Harvest API', { clientId: validatedArgs.id });
          const client = await this.config.harvestClient.updateClient(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(client, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'update_client');
        }
      }
    }
  • The 'update_client' tool registration, defining its schema and assigning the UpdateClientHandler.
      tool: {
        name: 'update_client',
        description: 'Update an existing client. Can modify name, active status, address, and currency. Only provided fields will be updated.',
        inputSchema: {
          type: 'object',
          properties: {
            id: { type: 'number', description: 'The ID of the client to update (required)' },
            name: { type: 'string', minLength: 1, description: 'Update client name' },
            is_active: { type: 'boolean', description: 'Update active status' },
            address: { type: 'string', description: 'Update client address' },
            currency: { type: 'string', minLength: 3, maxLength: 3, description: 'Update currency code' },
          },
          required: ['id'],
          additionalProperties: false,
        },
      },
      handler: new UpdateClientHandler(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