Skip to main content
Glama

delete_client

Archive a Harvest client to preserve historical project and billing data while removing them from active use.

Instructions

Delete (archive) a client. This action archives the client rather than permanently deleting it, preserving historical project and billing data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
client_idYesThe ID of the client to delete

Implementation Reference

  • The DeleteClientHandler class, which implements the ToolHandler interface, processes the request to delete a client via the Harvest API.
    class DeleteClientHandler 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, 'delete client');
          
          logger.info('Deleting client via Harvest API', { clientId: client_id });
          await this.config.harvestClient.deleteClient(client_id);
          
          return {
            content: [{ type: 'text', text: JSON.stringify({ message: `Client ${client_id} deleted successfully` }, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'delete_client');
        }
      }
    }
  • The registration of the 'delete_client' tool within the registerClientTools function, associating it with the DeleteClientHandler.
    {
      tool: {
        name: 'delete_client',
        description: 'Delete (archive) a client. This action archives the client rather than permanently deleting it, preserving historical project and billing data.',
        inputSchema: {
          type: 'object',
          properties: {
            client_id: { type: 'number', description: 'The ID of the client to delete' },
          },
          required: ['client_id'],
          additionalProperties: false,
        },
      },
      handler: new DeleteClientHandler(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