Skip to main content
Glama

delete_user

Archive a user account to preserve time tracking history while removing active access. This action maintains historical data rather than permanently deleting records.

Instructions

Delete (archive) a user. This action archives the user rather than permanently deleting them, preserving time tracking history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesThe ID of the user to delete

Implementation Reference

  • The implementation of the delete_user tool handler logic.
    class DeleteUserHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const inputSchema = z.object({ user_id: z.number().int().positive() });
          const { user_id } = validateInput(inputSchema, args, 'delete user');
          
          logger.info('Deleting user via Harvest API', { userId: user_id });
          await this.config.harvestClient.deleteUser(user_id);
          
          return {
            content: [{ type: 'text', text: JSON.stringify({ message: `User ${user_id} deleted successfully` }, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'delete_user');
        }
      }
    }
  • Registration of the delete_user tool, defining its schema and linking it to the handler.
    {
      tool: {
        name: 'delete_user',
        description: 'Delete (archive) a user. This action archives the user rather than permanently deleting them, preserving time tracking history.',
        inputSchema: {
          type: 'object',
          properties: {
            user_id: { type: 'number', description: 'The ID of the user to delete' },
          },
          required: ['user_id'],
          additionalProperties: false,
        },
      },
      handler: new DeleteUserHandler(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